Pageview

Track a pageview

POSTtracking/pageview

Pageviews are used to track what pages a visitor is browsing across your site. A visitor can visit any number of pages during a browsing session, and these will be automatically tracked using the JavaScript tracker so long as it is installed on every page.

We also use ping requests to tell our tracking systems that the visitor is still on that page - if we do not receive a successful ping for 30 seconds then they will be timed out.

Pageviews can currently only be tracked via the JavaScript tracker or direct via HTTP, and not with any other libraries.

POST Body

visitor_id

StringRequired

The anonymous visitor ID that this action is associated with.

timestamp

String

A valid ISO 8601 timestamp

page

ObjectRequired

url

StringRequired

title

String

previous

Number

The index of the previous page, which will be immediately unloaded

referrer

String

ip

String

IP address of the visitor. Used to detect the visitor's location

character_set

String

language

String

user_agent

String

returning

Boolean

screen

Object

height

Number

width

Number

pixel_ratio

Number

Screen DPR

depth

Number

Screen colour depth

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

campaign

Object

name

String

source

String

medium

String

content

String

term

String

location

Object

timezone_offset

Number

last_pageview

String

ISO 8601 timestamp of when this visitor/person last did a pageview

total

Object

visits

Number

pageviews

Number

Definition

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

Example Request

The Ruby library does not support this function at this time

Live Responseundefined undefined

Your API Key is not authorised for this endpoint