Use the Cometly API to send events from all your data sources to Cometly.
The Cometly API will receive data from your data sources so Cometly can match events back to the correct site visitor profile and ad. It's a requirement that the Comet script is installed on each page of your site just above the </head> tag for Cometly to accurately attribute events.
The Cometly API will only work for Comet Events spaces (workspaces). Please ensure your space is a Comet Events space prior to setup.
For the highest attribution accuracy, we require a IP and fingerprint. The fingerprint should be obtained from the available cometFingerprint() function available via the Cometly Pixel base code present on all pages of the site.
Important Testing Information:
The Cometly script activates the first time the visitor comes to your site and has a specific UTM configuration on the URL. When the visitor comes back again to your site organically without UTM's on your URL, the Cometly script will automatically identify the visitor is returning.
For testing the Cometly script and obtaining the fingerprint from the cometFingerprint() function, please append the following UTM parameters to your URL to activate the Cometly script for testing:
?utm_campaign=123456789&utm_source=facebook
Your URL should look like like this: https://example.com/?utm_campaign=123456789&utm_source=facebook
You can then easily identify the fingerprint inside the cometFingerprint() function.
For any questions, please contact developers@cometly.com
Each space (workspace) inside Cometly has a unique script. It's a requirement that the script is installed on each page of your site just above the </head> tag for Cometly to accurately attribute events
Obtaining Your Script
Cometly accounts can have multiple spaces (workspaces) and each space has a unique script. Ensure you are installing the correct script on your site if you have multiple spaces.
Visit the Tracking Page inside your Cometly account to retrieve the script.
After you are on the Tracking Setup page, click Setup Comet Events and copy the pixel. Install the script just above the </head> tag on every page of your site.
Since you're using the API to send events, you do not need to proceed to 'Step 2: Add your events'.
Each space (workspace) inside Cometly has a unique API token.
Obtaining Your API Token
Cometly accounts can have multiple spaces (workspaces) and each space has an API token. Cometly API can only work for Comet Events spaces.
Visit the Space Settings Integrations page for the Cometly space that you want to receive data and generate a new API token.
For security reasons, the API token will only be shown once, make sure to copy this token to a safe place. If you lose the token, you can always regenerate a new token in the future.
Authorization
Put the access token in the Authorization: Bearer <TOKEN> header.
Example: Authorization: Bearer 123
Required Headers
Accept: application/json
Content-Type: application/json
As of right now, we only have one endpoint which allows the posting of an event to our tracking engine.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
For purchase
If your event is associated with personal identifiable information, please include the email, name, and phone strings to fully use the Customer Journey feature. Please include as many attributes as possible below to improve accuracy.
Note: It's highly recommended that you include an IP, email, and fingerprint or uid for the best attribution accuracy.
However, depending on your data source, you may not be able to retrieve a required fingerprint or uid below.
In this scenario, you can send the email field without a fingerprint or uid and Cometly will attribute by email only. This could limit attribution accuracy depending on your marketing funnel. When only sending the email field, your marketing funnel must have a form in the beginning pages of the marketing funnel with an email field that our script will automatically capture.
For any questions, please contact developers@cometly.com
One of the following events is required:
lead_generated
view_content
schedule
purchase
subscribe
add_to_cart
contact
initiate checkout
add_payment_info
complete_registration
start_trial
sign_up
submit_application
webinar_registration
*required if uid or email is not present
The fingerprint should be obtained from the available cometFingerprint() function available via the Cometly tracking code. The function returns a promise that resolves to the fingerprint value.
Important Testing Information & Obtaining Fingerprint:
The Cometly script activates the first time the visitor comes to your site and has a specific UTM configuration on the URL. When the visitor comes back again to your site organically without UTM's on your URL, the Cometly script will automatically identify the visitor is returning.
For testing the Cometly script and obtaining the fingerprint from the cometFingerprint() function, please append the following UTM parameters to your URL to activate the Cometly script for testing:
?utm_campaign=123456789&utm_source=facebook
Your URL should look like like this:
https://example.com/?utm_campaign=123456789&utm_source=facebook
You can then easily identify the fingerprint inside the cometFingerprint() function.
*required if fingerprint or email is not present
If a fingerprint cannot be used, a unique identifier for this user should be passed to the public api. If this identifier is not unique, cross tracking will likely happen.
*required
*required
Customer & Hit Data:
Remove symbols, letters, and any leading zeros. Phone numbers must include a country code to be used for matching (e.g., the number 1 must precede a phone number in the United States). Always include the country code as part of your customers' phone numbers, even if all of your data is from the same country.
Example
Input: US phone number (650)555-1212
Normalized format: 16505551212
UTM Data:
Ecommerce Data:
Event Data:
Each API request has an associated request identifier. You can find this value in the response headers, under Request-Id. You can also find request identifiers in the URLs of individual request logs in your Dashboard. If you need to contact us about a specific request, providing the request identifier will ensure the fastest possible resolution.
Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.
Test mode secret keys have the prefix Alternatively, you can use for granular permissions.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
Test mode secret keys have the prefix Alternatively, you can use for granular permissions.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
Test mode secret keys have the prefix Alternatively, you can use for granular permissions.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
Test mode secret keys have the prefix Alternatively, you can use for granular permissions.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
Create a Custom HTML tag inside GTM with the script to the right.
using fingerprint
You can also find request identifiers in the URLs of individual request logs in your Dashboard. If you need to contact us about a specific request, providing the request identifier will ensure the fastest possible resolution.
Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.
Test mode secret keys have the prefix Alternatively, you can use for granular permissions.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
Test mode secret keys have the prefix Alternatively, you can use for granular permissions.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
Test mode secret keys have the prefix Alternatively, you can use for granular permissions.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
Test mode secret keys have the prefix Alternatively, you can use for granular permissions.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
The Stripe API uses API keys to authenticate requests. You can view and manage your API keys in the Stripe Dashboard.
Test mode secret keys have the prefix sk_test_ and live mode secret keys have the prefix sk_live_. Alternatively, you can use restricted API keys for granular permissions.
Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.
Authentication to the API is performed via HTTP Basic Auth. Provide your API key as the basic auth username value. You do not need to provide a password.
If you need to authenticate via bearer auth (e.g., for a cross-origin request), use -H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc" instead of -u sk_test_4eC39HqLyjWDarjtT1zdp7dc.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.
For card errors, the ID of the failed charge.
For some errors that could be handled programmatically, a short string indicating the error code reported.
Each API request has an associated request identifier. You can find this value in the response headers, under Request-Id. You can also find request identifiers in the URLs of individual request logs in your Dashboard. If you need to contact us about a specific request, providing the request identifier will ensure the fastest possible resolution.
Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.
Test mode secret keys have the prefix Alternatively, you can use for granular permissions.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
Test mode secret keys have the prefix Alternatively, you can use for granular permissions.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
Test mode secret keys have the prefix Alternatively, you can use for granular permissions.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
Test mode secret keys have the prefix Alternatively, you can use for granular permissions.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
The Stripe API uses API keys to authenticate requests. You can view and manage your API keys in the Stripe Dashboard.
Test mode secret keys have the prefix sk_test_ and live mode secret keys have the prefix sk_live_. Alternatively, you can use restricted API keys for granular permissions.
Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.
Authentication to the API is performed via HTTP Basic Auth. Provide your API key as the basic auth username value. You do not need to provide a password.
If you need to authenticate via bearer auth (e.g., for a cross-origin request), use -H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc" instead of -u sk_test_4eC39HqLyjWDarjtT1zdp7dc.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.
For card errors, the ID of the failed charge.
For some errors that could be handled programmatically, a short string indicating the error code reported.