Analytics ยท Track

For a light-weight, non real-time tracking solution a simple <img> or <script> tag is sufficient on every page.

This will set a cross-domain user-id cookie, and track referrer and user-agent only. Consult Mozilla's Developer Network documentation on the Referrer-Policy HTTP header and referrerpolicy HTML attribute to specify which information should be sent in the Referer HTTP request header. Make sure to understand the privacy implications of sending sensitive information to the ANALYTICS_URL endpoint.

<img src="${ANALYTICS_URL}/track?aid=${ACCOUNT_ID}"
     crossorigin="use-credentials"
     referrerpolicy="origin">

<script src="${ANALYTICS_URL}/track?aid=${ACCOUNT_ID}"
     crossorigin="use-credentials"
     referrerpolicy="origin"></script>

${ANALYTICS_URL} is the same endpoint as used by the JavaScript API.

Query string parameters

namerequireddescription
aidYesAccount id, similar to the one used in the JavaScript library.
typeNo

Type of response to return, default img.

  • img to return a 1x1 transparent pixel
  • json to return an empty JSON response
  • js to return an empty JavaScript response
Any otherNoThese query string parameters will be stored along with the tracked hit.