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 noevent_ideither, TikTok can fall back to the_ttpbrowser cookie, but only within 5 minutes, only if first-party cookies are on and your server sendsttp, 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
-
Open a private (incognito) window, open developer tools (F12), go to Network and filter by
analytics.tiktok.com/api/v2/pixel. -
Load the page, accept cookies, and trigger the events you care about (for example submit a test lead on your own site).
-
Click each request and look at the payload:
eventis the event name andevent_idis the ID."event_id": ""means the event has no ID. -
In your code or tag manager, look at the
ttq.trackcalls. 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.
-
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.
-
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' }); -
Send the same value as
event_idin the Events API event, with the same event name (Purchasehere) and the same pixel code asevent_source_id. -
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_idvariable is configured for you. -
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”).
-
Keep first-party cookies on (Tools > Events > Data sources > your pixel > Settings), so the
_ttpfallback still works for any event that slips through without an ID. -
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
- In the Network tab, every
analytics.tiktok.com/api/v2/pixelrequest for your key events carries a non-emptyevent_id, and it changes between actions. - For one test conversion, the server sends the same
event_idand event name. - In Events Manager, the “Server & Browser” figures for that event grow (this takes some time; data is not shown in real time).
- Re-run the check on IsPixelWorking. The issue should be gone.
Sources
- TikTok API for Business, Event Deduplication (keys
event_source_id,eventandevent_id; keep the first, discard later copies within 48 hours, merge within 5 minutes;_ttpfallback; unique IDs; Server & Browser metrics): https://business-api.tiktok.com/portal/docs?id=1771100965992450 - TikTok Business Help Center, Event deduplication: https://ads.tiktok.com/resources/help/article/event-deduplication?lang=en
- TikTok API for Business, Events API 2.0 setup guide for Web (
event_idrequired when sending from both pixel and Events API; first-party cookies setting): https://business-api.tiktok.com/portal/docs?id=1771100865818625 - TikTok API for Business, Events API and Pixel setup with Google Tag Manager (interactive setup configures an
event_idvariable): https://business-api.tiktok.com/portal/docs?id=1799004052020225 - TikTok on GitHub, TikTok Pixel GTM template (De-duplication Configurations > Event ID): https://github.com/tiktok/gtm-template-pixel
- Stape, Unique Event ID variable: https://stape.io/helpdesk/documentation/unique-event-id
More TikTok guides
- TikTok Pixel fires before cookie consent: how to fix it
- TikTok Pixel not firing after cookie consent: how to fix it
- Repeated TikTok event IDs drop real conversions: how to fix
- Duplicate TikTok Pixel events: how to find and remove them
- TikTok click ID (ttclid) lost after an ad click: how to fix it
- TikTok Pixel tracks a button on desktop but not on mobile
- Two TikTok Pixels on one site: when it's fine, how to fix
- TikTok Events API deduplication: match the pixel's event_id
- How to set up the TikTok Events API (with deduplication)