Fix guide · Shopify · easy · about 20 min
Duplicate TikTok Pixel events on Shopify
For the finding “Duplicate TikTok events”. Also for: Any website, WordPress, Webflow, Framer.
What this means
The same event (for example a page view or AddToCart) was sent twice for the same TikTok pixel within about a second. On Shopify, this nearly always means the TikTok Pixel is installed in two places. A common pair: TikTok’s own TikTok app (the sales channel), which installs the pixel with no changes to website code, plus base code that was pasted into the theme earlier or rebuilt as a custom pixel. Shopify’s help says to remove or modify existing pixels before you add a custom pixel, so that customer events aren’t counted twice.
TikTok discards repeats that carry the same event name and the same event_id within 48 hours. But the TikTok Pixel does not fill in an ID by itself (you can see the empty event_id field in the Network tab), and TikTok asks advertisers to choose a unique ID for each event, so two copies without IDs look like two separate conversions.
Why it costs you money:
- TikTok counts some conversions twice, so reports look better than reality and your cost per result looks lower than it is.
- Campaigns learn from inflated, noisy data and may spend budget on the wrong people.
This is about two identical browser events. A browser event plus a server (Events API) event for the same action is expected: with the Enhanced or Maximum data sharing level, the TikTok app also sends events through the Events API, and TikTok merges the pair when both carry the same event_id.
How to confirm it yourself
Our check runs from a browser in the EU and accepts the cookie banner before looking for duplicates.
- Open your store in a private (incognito) window, open developer tools (F12), go to Network and filter by
analytics.tiktok.com/api/v2/pixel. - Accept cookies.
- In each request’s payload,
context.pixel.codeis the pixel ID andeventis the event name. Two requests with the same pixel code and the same event at almost the same moment are a duplicate. Different pixel codes mean two different pixels, which is a separate finding (“More than one TikTok Pixel”). - To see where each copy comes from, compare the page address each request reports (under
context,page,url). Shopify documents that custom pixels run in a sandbox frame whose address is not your store page, so a copy that reports a Shopify sandbox address (containing/sandbox/) is a custom pixel. A copy that reports your normal page address runs on the page itself or comes from an app. - Repeat on a product page (
ViewContent), after adding a product to the cart (AddToCart) and in checkout. The TikTok app supports View Content, Add to Cart, Initiate Checkout, Add Payment Info, Complete Payment, Search, Add to Wishlist, Complete Registration and Subscribe, so each of these should appear once per pixel code. TreatCompletePaymentandPurchaseas the same event when you compare: TikTok renamedCompletePaymenttoPurchaseand converts the old name on its side.
The TikTok Pixel Helper extension lists the pixels and events on a page, and Test Events in TikTok Events Manager (Tools > Events > Data sources > your pixel) shows which events arrive.
How to fix
Keep exactly one installation per pixel ID and remove the rest.
-
List every place a Shopify store can load the pixel:
- Sales channels > TikTok: whether the app is installed, its data sharing level and which pixel it is connected to.
- Settings > Customer events: app pixels that send TikTok events (third-party TikTok pixel apps and other tracking apps often include one), and every custom pixel (look for
ttqor your pixel ID in its code). - Theme code: go to Online Store, open the menu of your current theme, click Edit code, open
theme.liquidand search foranalytics.tiktok.comandttq.load(. Check the snippets it includes too. - App embeds: Online Store > Edit theme > App embeds icon.
- Google Tag Manager: TikTok Pixel tags and Custom HTML tags with
ttq. GTM itself can also be installed twice (intheme.liquidand as a custom pixel); then every tag fires twice.
-
Keep one installation. For most stores this is the TikTok app’s pixel: TikTok says it measures events through the checkout and payment pages, and on the Enhanced or Maximum level the app adds the Events API next to the pixel. Then:
- delete the TikTok base code from
theme.liquidand click Save; - disconnect custom pixels that send TikTok events for the same pixel ID (Disconnect keeps the code, so you can delete it later);
- remove TikTok tags from GTM;
- turn off app embeds, or uninstall other apps, that add another TikTok pixel.
If you would rather keep a custom pixel or another app, disconnect the TikTok app’s pixel instead, so that only one copy sends browser events. TikTok does not document the screen for this; Elevar, a third-party tracking vendor, describes it as Sales channels > TikTok > Settings > Data sharing, then Disconnect in the Customer Data Sharing section. Disconnecting the whole TikTok integration also uninstalls the app, so do not use that just to remove a duplicate. Before you choose a custom pixel, note that TikTok’s code in Shopify’s sandbox may not see
ttclidin the address or keepttclidand_ttpon your store’s domain; see TikTok click ID lost on Shopify. - delete the TikTok base code from
-
Check purchase tracking added during the checkout upgrade. Shopify has retired Additional scripts and script tags on the Thank you and Order status pages (the last deadline was August 26, 2026), and theme code does not run in checkout. Purchase tracking was often rebuilt as a custom pixel at that point. Custom pixels load on the storefront, checkout, Thank you and Order status pages, so a custom pixel that sends
PurchaseorCompletePaymentnext to the TikTok app doubles every order. -
Check page views inside a custom pixel. TikTok’s base code ends with
ttq.page(), which sends a page view. If the same custom pixel also sends a page view from ananalytics.subscribe("page_viewed", ...)subscription, every page view is sent twice. Keep one of the two. -
Merge custom pixels that use the same pixel ID (for example one named for checkout and one for the storefront). Each one loads on every storefront and checkout page, so each sends its events everywhere unless its code says otherwise.
-
Check GTM for two tags that send the same event on overlapping triggers, and keep one.
-
Save every change, and publish GTM if you changed it.
Event IDs are a safety net, not the fix: with your own event_id on each action, an accidental second copy carries the same ID and TikTok discards it. Remove the extra copy anyway.
Common causes
- TikTok base code is still in
theme.liquidafter the TikTok app was connected. - A custom pixel sends TikTok events for the same pixel ID as the app.
- Purchase tracking was rebuilt as a custom pixel during the Thank you page upgrade, while the app also tracks purchases.
- A third-party app adds its own TikTok pixel through an app embed or an app pixel.
- GTM runs twice, or two GTM tags send the same event.
How to verify the fix
- In a private window, accept cookies and check that each event appears once per pixel code: on page load, on a product page and after adding to cart.
- Place a test order and check in TikTok Events Manager’s Test Events that the purchase arrives once from the browser.
- Re-run the check on IsPixelWorking. The issue should be gone.
Questions people ask
Do I need to add TikTok Pixel code to my theme if I use the TikTok app?
No. TikTok says the app installs the TikTok Pixel and Events API with no changes to website code. Extra base code in theme.liquid sends a second copy of each event.
Sources
- Shopify Help Center, Manage your custom pixels (remove existing pixels so events aren’t counted twice; connect, disconnect, delete): https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels/manage
- Shopify Help Center, Pixels overview (pixels load on the storefront, checkout, Thank you and Order status pages): https://help.shopify.com/en/manual/promoting-marketing/pixels/overview
- Shopify Help Center, Create custom pixel code (
page_viewedsubscription example): https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels/code - Shopify Help Center, Migrating pixels (remove old pixel code before connecting a new pixel to avoid duplicate tracking): https://help.shopify.com/en/manual/promoting-marketing/pixels/pixel-migration
- Shopify Help Center, Upgrading and replacing your Thank you and Order status pages (August 26, 2026 deadline): https://help.shopify.com/en/manual/checkout-settings/customize-checkout-configurations/upgrade-thank-you-order-status
- Shopify.dev, Order status script tags (deadlines August 28, 2025 for Plus, August 26, 2026 for other stores): https://shopify.dev/docs/apps/build/online-store/script-tag-deprecation/order-status
- Shopify.dev, About web pixels (custom pixels run in a sandbox iframe): https://shopify.dev/docs/apps/build/marketing/pixels
- Shopify.dev, checkout.liquid (unsupported for the Information, Shipping and Payment steps; sunset for the Thank you and Order status pages): https://shopify.dev/docs/storefronts/themes/architecture/layouts/checkout-liquid
- Shopify Help Center, Extend your theme with apps (app embeds): https://help.shopify.com/en/manual/online-store/themes/customizing-themes/apps
- TikTok Business Help Center, About TikTok on Shopify (pixel and Events API with no changes to website code; checkout and payment pages): https://ads.tiktok.com/resources/help/article/tiktok-app-shopify?lang=en
- TikTok Business Help Center, Data Sharing on TikTok App on Shopify (Enhanced and Maximum include the Events API): https://ads.tiktok.com/resources/help/article/data-sharing-tiktok-app-shopify?lang=en
- TikTok Business Help Center, Supported Events by Shopify: https://ads.tiktok.com/resources/help/article/supported-events-shopify?lang=en
- TikTok Business Help Center, How to adopt TikTok’s updated standard events (
CompletePaymentrenamed toPurchase, converted on the backend): https://ads.tiktok.com/resources/help/article/how-to-adopt-tiktoks-updated-standard-events?lang=en - TikTok Business Help Center, Disconnect the Integration (disconnecting uninstalls the TikTok app): https://ads.tiktok.com/resources/help/article/disconnect-integration?lang=en
- TikTok API for Business, Event Deduplication (same event and
event_idwithin 48 hours): https://business-api.tiktok.com/portal/docs?id=1771100965992450 - TikTok Business Help Center, Event deduplication (pixel-to-pixel duplicates): https://ads.tiktok.com/resources/help/article/event-deduplication?lang=en
- TikTok API for Business, Install Pixel using code (base code ends with
ttq.page()): https://business-api.tiktok.com/portal/docs?id=1739585702922241 - TikTok Business Help Center, TikTok Pixel Helper: https://ads.tiktok.com/resources/help/article/tiktok-pixel-helper-2.0?lang=en
- Elevar (third-party vendor; TikTok does not document this screen), How to disable TikTok Pixel in Shopify: https://docs.getelevar.com/docs/how-to-disable-tiktok-pixel-in-shopify
More TikTok guides
- TikTok Pixel fires before cookie consent on Shopify
- TikTok Pixel not firing after cookie consent on Shopify
- Repeated TikTok event IDs drop real conversions: how to fix
- TikTok Pixel events have no event ID on Shopify
- TikTok click ID (ttclid) lost on Shopify
- 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)