Ping

Ping the tracking session

POSTtracking/ping

In order to know that a user is still on your website, a ping must be received at least once every 30 seconds. If no ping is received then the session will be timed out.

Note: This function is primarily useful for building custom libraries or advanced tracking processes. In the vast majority of cases the library for your language or the tracking code will manage pinging GoSquared for you.

POST Body

visitor_id

StringRequired

The anonymous visitor ID that this action is associated with.

page

ObjectRequired

index

NumberRequired

The page index that this event is associated with

engaged_time

NumberDefault Value: 0

Amount of time (in milliseconds) spent actively interacting with the page since the last ping

scroll

Object

top

Number

left

Number

max

Object

The furthest the user has scrolled on the page during this session

top

Number

left

Number

document

Object

height

Number

width

Number

viewport

Object

height

Number

width

Number

Definition

POST https://api.gosquared.com/tracking/v1/ping

Example Request

curl -X POST -H "Content-Type: application/json" \
  "https://api.gosquared.com/tracking/v1/ping?api_key=demo&site_token=GSN-106863-S" 

Live Responseundefined undefined

Your API Key is not authorised for this endpoint