Use this setup to track Universe.com ticket purchases in Cometly and attribute them back to the correct ad or traffic source. This works by sending a custom browser event with the Universe ticket_id, then matching that same ticket_id inside the Cometly webhook as the tracking_id.
Why This Matters
Universe purchases happen inside a popup checkout, so you cannot rely on a standard thank you page conversion.
This setup helps Cometly:
capture the session and source data from the browser
create an anonymous contact tied to that session
match the final purchase data from the webhook
attribute the conversion back to the correct ad, campaign, or source
How It Works
When someone completes a purchase through the Universe checkout popup, two things happen:
Browser side
Universe’s embed script fires a JavaScript event called unii:ticket:purchased.
Your website listens for that event, grabs the ticket_id, and sends a custom event to Cometly such as u_purchase.
This custom event is not the actual purchase conversion. Its purpose is to:
register an event on the anonymous contact
store the session data
save the
ticket_idso Cometly can match it later
Server side
Universe sends a webhook with the full purchase data.
Inside the webhook payload, the same ticket ID is available as ticket.id.
When configuring the Cometly webhook, map ticket.id from the Universe payload to the tracking_id field in Cometly.
Cometly then matches the incoming webhook event to the earlier browser event using that shared tracking_id.
Step 1: Create a Custom Event in Cometly
First, create a custom event in Cometly (see the Custom Events article for full steps).
After creating it, Cometly will assign it an internal event name like:
custom_event_1custom_event_2etc.
👉 You must use this internal event name (shown in the event settings) when sending events from your website.
For example:
If your event shows as
custom_event_2, that is what you will use in your tracking script
💡 Pro Tip: The display name (like “U Purchase”) is just for your reference. The actual event sent to Cometly must use the custom_event_X value shown in the setup panel.
This event should only be used for browser-side matching.
⚠️ Note: Do not use Purchase for the browser event. You will send the real Purchase event server-side via webhooks.
Using Purchase on both the browser and server would create duplicate conversions. Instead, use a custom event (like U Purchase) on the browser to capture session data, and reserve Purchase for the webhook as the single, final conversion event.
That gives you clean conversion tracking while still preserving attribution data from the original session.
Optional: Disable sending to the Conversion API if you do not want this event treated as a conversion.
💡 Pro Tip: In most cases, you should turn this off. The browser event is only used for session tracking and matching, while the actual conversion (like Purchase) should come from the webhook.
This browser event is only there to register the event on the anonymous contact and preserve the session data for matching.
Step 2: Add the Tracking Script to Your Website
Place this script on every page where the Universe checkout popup can be triggered.
It must be added:
after the Cometly pixel
after Universe’s
embed2.jsscript
<script>
document.addEventListener('unii:ticket:purchased', function(event) {
var ticketId = event.detail && event.detail.ticket_id;
if (ticketId) {
comet('custom_event_2', { tracking_id: ticketId });
}
});
</script>
What This Script Does
listens for Universe’s built-in
unii:ticket:purchasedeventpulls the unique
ticket_idsends a custom browser event to Cometly using
u_purchasestores that event on the anonymous contact along with the session and source data
Step 3: Set Up the Universe Webhook
In your Universe account:
Log in to Universe
Go to Settings
Open Account
Scroll to Webhooks
Click Add Webhook
Enter your webhook URL
Set a secret for verification
mark it Active
save
Universe will now send a JSON webhook every time a ticket is purchased.
The payload includes the ticket ID as ticket.id.
Step 4: Configure the Cometly Webhook Mapping
When the Universe webhook is sent to Cometly, map the Universe payload fields into the Cometly webhook fields.
The key part is this:
map
ticket.idfrom the Universe payload to tracking_id in Cometly
This is what allows Cometly to match the purchase data to the earlier browser event.
Important
The browser event and the webhook must use the same exact ID.
Browser event sends
tracking_id: ticketIdWebhook maps
ticket.id→tracking_id
If those values match, Cometly can connect the anonymous session to the final purchase event.
Step 5: Map the Purchase Event in the Webhook
Inside Cometly, map the Universe webhook to your real conversion event, such as:
Purchase
or another revenue event you want to use
This webhook event is the actual conversion event.
The browser event u_purchase is only there for matching and session capture.
⚠️ Common Mistakes
using
Purchaseas the browser eventforgetting to disable Conversion API sending for
u_purchaseplacing the script before the Cometly pixel or Universe script
not mapping
ticket.idtotracking_idin the Cometly webhookusing different ID values between the browser event and the webhook

