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
name | required | description |
---|---|---|
aid | Yes | Account id, similar to the one used in the JavaScript library. |
type | No | Type of response to return, default
|
Any other | No | These query string parameters will be stored along with the tracked hit. |