Overview
ThecometToken() function is available through the Cometly tracking pixel and returns a unique identifier that links a user’s browser session to their attribution data. When sending events via the API, including the comet token significantly improves attribution accuracy.
Using cometToken()
ThecometToken() function returns a string value directly:
Sending Events with Comet Token
When sending events to the API, include thecomet_token parameter for better attribution:
Prerequisites
The Cometly tracking pixel must be installed on your website forcometToken() to be available.
Common Use Cases
Form Submissions
Capture the comet token when a form is submitted:OAuth Sign Up (Google, Apple, etc.)
When users sign up via OAuth providers, Cometly’s automatic form capture doesn’t work. You must capture the comet token when the user clicks the OAuth button and include it when sending the event. See Tracking Events When Using OAuth Sign Up for details.See Also
- Create Event - API endpoint for sending events
- Cometly Help Center - Installation guides and troubleshooting