Fix guide · Any website · advanced · about 60 min

TikTok Pixel event_id missing: how to add it for deduplication

For the finding “TikTok events have no event ID”. Also for: Shopify, WordPress, Webflow, Framer.

What this means

Each event the TikTok Pixel sends can carry an event ID (event_id): a unique label for that one action. Your site’s events arrive with an empty event_id. The TikTok Pixel does not make one up by itself: TikTok asks advertisers to choose a unique ID for each event, and if your code does not pass one, the field in the request stays empty.

Whether this costs you money depends on one question: does your site also send these events to TikTok from a server, through the TikTok Events API?

  • Yes, or you are not sure: TikTok deduplicates a browser event and a server event when they share the pixel code, the event name and the event_id. When the server event has no event_id either, TikTok can fall back to the _ttp browser cookie, but only within 5 minutes, only if first-party cookies are on and your server sends ttp, and only by dropping the server copy. Otherwise both copies can count, and campaigns optimize on inflated numbers.
  • No, you only use the browser pixel: there is nothing to deduplicate yet, so this has little effect today. It matters the day you add the Events API, a partner integration that sends server events, or the Events API Gateway.

We cannot see server-to-server traffic from a browser, so we cannot tell whether your Events API works. We only see whether the browser events carry an ID.

Events the pixel creates by itself (for example its automatic page views on single-page sites) never carry your IDs; this is about the events your site sends with ttq.track.

How to confirm it yourself

  1. Open a private (incognito) window, open developer tools (F12), go to Network and filter by analytics.tiktok.com/api/v2/pixel.

  2. Load the page, accept cookies, and trigger the events you care about (for example submit a test lead on your own site).

  3. Click each request and look at the payload: event is the event name and event_id is the ID. "event_id": "" means the event has no ID.

  4. In your code or tag manager, look at the ttq.track calls. The ID goes in the third argument:

    // No event ID
    ttq.track('Lead', { value: 10, currency: 'EUR' });
    
    // With an event ID
    ttq.track('Lead', { value: 10, currency: 'EUR' }, { event_id: 'lead-8f3a2c' });

In TikTok Events Manager, the pixel’s detail page shows “Browser”, “Server” and “Server & Browser” figures; TikTok says that if the “Server & Browser” numbers are too low, you should check your deduplication setup. View details under the Event Health column shows matching and deduplication health.

How to fix

TikTok keeps the first copy of an event and discards later copies with the same pixel code, event name and event_id that arrive within 48 hours. If the second copy arrives within 5 minutes, TikTok tries to merge its data into the first. So the fix has two halves: give the browser event an ID, and send exactly the same ID with the server event.

  1. Generate one unique ID per action. TikTok suggests order numbers or transaction IDs; a random string works for other events, as long as it is the same in the pixel and the Events API. Never reuse a fixed value: TikTok would treat every later event with that ID as a duplicate.

  2. Pass it to the pixel in the third argument of ttq.track:

    ttq.track('Purchase', {
      value: 49.90,
      currency: 'EUR',
      content_type: 'product',
      contents: [{ content_id: 'SKU-123', quantity: 1, price: 49.90 }]
    }, { event_id: 'order-10482' });
  3. Send the same value as event_id in the Events API event, with the same event name (Purchase here) and the same pixel code as event_source_id.

  4. If you use Google Tag Manager: in TikTok’s TikTok Pixel tag template, fill De-duplication Configurations > Event ID with a variable that creates a new value per event (for example Stape’s Unique Event ID variable from the Community Template Gallery), and pass the same value to your server container. TikTok says that if you set up GTM through its interactive flow in Events Manager, an event_id variable is configured for you.

  5. If you use a partner integration or plugin: most of them set matching IDs for the browser events they send. If you also have a separate, manually installed pixel, its events will have no ID. Remove the manual pixel (a second pixel usually also shows up as “Duplicate TikTok events”).

  6. Keep first-party cookies on (Tools > Events > Data sources > your pixel > Settings), so the _ttp fallback still works for any event that slips through without an ID.

  7. Publish your changes.

Common causes

  • The pixel was installed with TikTok’s standard base code and event snippets, which do not include event_id.
  • The Events API was added later (through a plugin, a partner integration or server-side GTM) and the browser side was never updated.
  • A tool sets IDs on its server events, but the browser events come from an older, separate pixel installation.
  • The browser and the server each generate their own ID, so the two never match.

How to verify the fix

  1. In the Network tab, every analytics.tiktok.com/api/v2/pixel request for your key events carries a non-empty event_id, and it changes between actions.
  2. For one test conversion, the server sends the same event_id and event name.
  3. In Events Manager, the “Server & Browser” figures for that event grow (this takes some time; data is not shown in real time).
  4. Re-run the check on IsPixelWorking. The issue should be gone.

Sources

More TikTok guides