Serverside Page View

Sends a serverside tracking page view to the sitesights.io backend.

POST
https://app.sitesights.io/api/page-view

If you want to know more about the ClientId Parameter, you should checkout the following this link.

Root object object required

Root object

Metrics object required

This holds all of the information about the visitor.

Browser object required

Holds information about browser.

IP string required

Valid IP Address of the visitor.

UserAgent string or empty string required

UserAgent or empty string of the visitor.

Identify object required

Identifier container

ClientId string or null

Optional string identifier to identify current visitor. This is very specific to your website, for example if a lot of your users have an account and are logged in. You could use their Unqiue Account ID here (This will be hashed beyond recognition) or if you get the permission of your visitor, you can use something like fingerprinting. For a much more detailed explaination, please go here.

Language object required

Holds information about languages

Code string required

Language code

Close allowed values
Expand allowed values
ISO Language Codes
ISO 639-1 2 Letter Codes
Page object required

Holds information about the page

Absolute string required

Complete valid absolute URL including query part

Referrer object required

Holds information about the referrer page

Absolute string

Complete valid absolute URL including query part

Screen object required

Holds information about the screen size

Height double or float or int required

Screen height in pixels

Width double or float or int required

Screen width in pixels

Location object required

Holds information about the location

ContinentCode string or null

Continent Code

Close allowed values
Expand allowed values
AF
Africa
NA
North America
OC
Oceania
AN
Antarctica
AS
Asia
EU
Europe
SA
South America
CountryCode string or null

ISO_3166-1 Alpha-2 code

City string or null

City Name

PostalCode string or null

Postal code

Region string or null

Region Name

RegionCode string or null

Region Code

Timezone string or null

Timezone Name

Filling the Location can be done by sending the ip address to a service that returns you the needed information.

If you are using Cloudflare or a similar Service, you can enable the Geolocation IP Headers. This would make it easy, because you have the needed information in the headers of the request coming from your clientside already.

root object object

The response json

Code number

Code to determine success or error

Close allowed values
Expand allowed values
200
Success
401
Unauthorized
400
Malformed Body
429
Monthly contigent exceeded
Message string

Description of errors

Request body
{
  "Metrics": {
    "Browser": {
      "IP": "91.48.119.123",
      "UserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/116.0"
    },
    "Identify": {
      "ClientId": null
    },
    "Language": {
      "Code": "en"
    },
    "Location": {
      "CountryCode": "AF",
      "ContinentCode": "AF",
      "City": "test",
      "Region": null,
      "RegionCode": null,
      "PostalCode": "33100",
      "Timezone": null
    },
    "Page": {
      "Absolute": "https://app.sitesights.io/analytics"
    },
    "Referrer": {
      "Absolute": null
    },
    "Screen": {
      "Width": 200,
      "Height": 200
    }
  }
}