Skip to main content

Universe.com Ticket Purchase Tracking

Learn how to track ticket purchases from Universe.com in Cometly.

Updated today

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_id so 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_1

  • custom_event_2

  • etc.

👉 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.js script

<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:purchased event

  • pulls the unique ticket_id

  • sends a custom browser event to Cometly using u_purchase

  • stores that event on the anonymous contact along with the session and source data


Step 3: Set Up the Universe Webhook

In your Universe account:

  1. Log in to Universe

  2. Go to Settings

  3. Open Account

  4. Scroll to Webhooks

  5. Click Add Webhook

  6. Enter your webhook URL

  7. Set a secret for verification

  8. mark it Active

  9. 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.id from 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: ticketId

  • Webhook maps ticket.idtracking_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 Purchase as the browser event

  • forgetting to disable Conversion API sending for u_purchase

  • placing the script before the Cometly pixel or Universe script

  • not mapping ticket.id to tracking_id in the Cometly webhook

  • using different ID values between the browser event and the webhook

Did this answer your question?