Skip to main content

Supported data types

Pageviews

Product page visits

Orders

Purchase transactions

Prerequisites

  • The product ID must match the one in your e-commerce system
  • Your unique Dema ID, formatted as DV-XXXXXXXXXXXXXXXXXXXXXXXX

Request details

Endpoint

  • URL: https://tracker.dema.ai/track.js

HTTP method

  • Method: GET

Headers

Send the visitor’s IP address and user agent as headers. Dema reads them from the request headers only, and ignores an ip field in m, including one inside order. Without these headers, Dema records your server’s IP address and user agent instead of the visitor’s, so location and bot filtering see your server rather than the visitor.

Request parameters

Common parameters for all events

  • e: Event type. Accepts "pageview" or "order".
  • i: Your unique Dema ID.
  • v: Version of your tracking script (e.g., "1.0.0").
  • uid: The visitor’s user ID, managed server-side. Must be a UUIDv4 in its standard text form (xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx) and stay the same for the visitor across events. Events whose uid isn’t a valid UUID are discarded.
  • _nc: Cache-buster. Send a unique value with each request, such as the current timestamp in milliseconds. Dema doesn’t use it as the event time.
  • u: The full URL of the page visited.
  • r: The referring URL, if available.

Send each event as it happens. Dema records the time it receives a request as the event time, and doesn't read a time from the request itself. If you queue or batch events to send later, for example while waiting for cookie consent, each delayed event gets the time it arrives, not the time the visitor acted. This can split one visit into two sessions and move events to the wrong time or day.

Event-specific parameters

  • m: Additional event data in JSON string format.
Pageview event
For a pageview on a product page, include:
Order event
For an order event, include detailed order information:

Examples of curl requests

Replace placeholder values (YOUR-DEMA-ID, YOUR-UUID, YOUR-TIMESTAMP, VISITOR-IP, and VISITOR-USER-AGENT) with actual data specific to your implementation.

Additional notes

  • Ensure all URL parameters are properly URL-encoded. The examples provided have been encoded accordingly.
  • The management of the unique user ID (uid) must be handled server-side. This ID must be a UUIDv4 in its standard text form (xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx) and stay consistent across events to track user behavior accurately.