Skip to content

Payload ​

getPayload() returns an object ready to send with your API requests. Merge it into your request body so every submission carries its full attribution history.

json
{
  "tracking": {
    "first_visit_time": "2026-01-01T10:00:00.000Z",
    "first_source": "Google Ads",
    "last_source": "WhatsApp",
    "touches_count": 3,
    "touches": [
      {
        "source": "Google Ads",
        "utm_source": "google",
        "utm_medium": "cpc",
        "utm_campaign": "winter-sale",
        "timestamp": "2026-01-01T10:00:00.000Z"
      }
    ]
  }
}

Fields ​

FieldTypeDescription
first_visit_timestringISO timestamp of the visitor's first recorded touch.
first_sourcestringThe resolved source of the first touch.
last_sourcestringThe resolved source of the most recent touch.
touches_countnumberTotal number of recorded touches.
touchesTouch[]The full ordered list of touches.

Each entry in touches includes the resolved source, the raw UTM fields when present, and the timestamp it was recorded.

Released under the MIT License.