Fix guide · WordPress · easy · about 30 min
Duplicate TikTok Pixel events on WordPress
For the finding “Duplicate TikTok events”. Also for: Any website, Shopify, Webflow, Framer.
What this means
The same event (for example a page view, AddToCart or a form event) was sent twice for the same TikTok pixel within about a second. On WordPress this nearly always means two plugins, or a plugin and a pasted code snippet, both load the TikTok Pixel.
TikTok discards repeats with the same event name and the same event_id within 48 hours. TikTok’s own plugin gives its main events an ID, but a second, hand-pasted copy usually sends none, so the two copies 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 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; TikTok merges that pair when both carry the same event_id.
How to confirm it yourself
- Log out of WordPress or use a private (incognito) window: some tracking plugins skip logged-in administrators.
- Open developer tools (F12), go to Network and filter by
analytics.tiktok.com/api/v2/pixel. - Load the page and accept cookies.
- In each request’s payload,
eventis the event name andcontext.pixel.codeis the pixel ID. Two requests with the same pixel code and the same event at almost the same moment are a duplicate. Different pixel codes mean two pixels, which may be intended; see “More than one TikTok Pixel”. - On a WooCommerce store, click Add to cart on a product:
AddToCartshould appear once per pixel code. Also submit a test form on your own site.
The TikTok Pixel Helper extension lists the pixels and events on a page, which makes a second installation easy to spot.
How to fix
- List every place the pixel can come from. Right-click the page, choose View page source and search for
analytics.tiktok.comandttq.load(. Then check:- Plugins > Installed Plugins for TikTok (TikTok’s official plugin, called TikTok for WooCommerce by WooCommerce), PixelYourSite, Pixel Manager for WooCommerce or any other tracking plugin. TikTok’s plugin shows up in the source as inline scripts whose IDs start with
tiktok-pixel-tracking-handle-headerandtiktok-tracking-handle-header; - snippet plugins such as WPCode, and Elementor Pro’s Custom Code;
- your theme’s options (for example Divi’s Theme Options > Integration tab) and the theme’s
header.phpfile; - your Google Tag Manager (GTM) container, and how GTM itself is added (Site Kit by Google, GTM4WP or a snippet).
- Plugins > Installed Plugins for TikTok (TikTok’s official plugin, called TikTok for WooCommerce by WooCommerce), PixelYourSite, Pixel Manager for WooCommerce or any other tracking plugin. TikTok’s plugin shows up in the source as inline scripts whose IDs start with
- Choose one installation to keep. Keep a plugin that sends both browser and server events, so the two share event IDs: TikTok’s plugin, PixelYourSite Professional or Pixel Manager for WooCommerce Pro. If you manage everything in GTM, keep GTM. WooCommerce’s documentation for TikTok’s plugin says to remove an existing TikTok pixel from your site when you set it up, and TikTok’s plugin page warns that a custom setup next to it may need extra deduplication work.
- Remove the other copies.
- Pasted code: delete the TikTok snippet from WPCode, Elementor Custom Code, theme fields or theme files. Deleting only the
ttq.track(...)lines is not enough if the base code withttq.load(...)is still there twice. - A second tracking plugin: remove the TikTok pixel ID from the one you do not keep (PixelYourSite Pro > TikTok or, in Pixel Manager, Tracking Pixels > TikTok).
- TikTok’s plugin, if you do not keep it: disconnect it in its settings (Marketing > TikTok on WooCommerce sites, TikTok in the dashboard menu otherwise) before you deactivate it. TikTok notes that removing its app first can cause problems with disconnecting.
- GTM: delete TikTok tags for events your plugin already sends.
- Pasted code: delete the TikTok snippet from WPCode, Elementor Custom Code, theme fields or theme files. Deleting only the
- Watch for two page views. TikTok’s plugin sends its page view as a
track('Pageview', ...)call with an event ID; standard TikTok base code sends one withttq.page(). If both are on the page, every page view is counted twice, and the two do not share an ID. - Check the plugin’s form events. TikTok’s plugin also sends events for forms on its own:
ContactorSubmitFormwhen a form is submitted (with listeners for Contact Form 7, WPForms, Ninja Forms, Mailchimp for WordPress, MailPoet, Spectra, Jetpack and a general one for any form), andClickButtonon button clicks. In the plugin’s code (version 1.4.2), forms from Mailchimp for WordPress, Spectra and Jetpack are caught by both their own listener and the general one, so one submission can send two events. If GTM, a form plugin or PixelYourSite also sendsLeadfor the same form, you get more. Test each form and keep one sender. - Make sure GTM is added only once. In Site Kit, whether it adds the container is the Let Site Kit place code on your site toggle under Site Kit > Settings > Connected Services > Tag Manager > Edit. GTM4WP can also add the container, and so can a theme snippet. Keep one. In the Network tab, filter by
gtm.js: each container ID should load once. - Check GTM for overlapping tags, for example a lead tag on a form trigger and another on the thank-you page.
- Clear every cache (plugin, host and CDN), so visitors stop getting pages with the old code.
Adding your own event_id to each action is a safety net: an accidental second copy then carries the same ID and TikTok discards it. It does not replace removing the extra copy. See the general guide for single-page sites and historyObserver.
Common causes
- TikTok’s plugin was installed, and the base code pasted earlier into a snippet plugin, theme field or Elementor Custom Code was never removed.
- Two tracking plugins (for example TikTok’s plugin and PixelYourSite) both load the same pixel.
- The pixel is in a plugin and in a GTM tag.
- GTM is added twice, for example by Site Kit or GTM4WP and by a theme snippet.
- A form is tracked by TikTok’s plugin and again by GTM or another plugin.
- A theme or child theme came with TikTok code in its
header.php.
How to verify the fix
- Clear all caches. In a private window, accept cookies and check that each event appears once per pixel code: on page load, after Add to cart on a store, and after a test form submission.
- Re-run the check on IsPixelWorking. The issue should be gone.
Sources
- TikTok API for Business, Event Deduplication (same event and
event_idwithin 48 hours, also pixel to pixel): 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 with
ttq.loadandttq.page): https://business-api.tiktok.com/portal/docs?id=1739585702922241 - WordPress.org, TikTok (official plugin; a custom setup may need deduplication work): https://wordpress.org/plugins/tiktok-for-business/
- WooCommerce, TikTok for WooCommerce documentation (remove your existing TikTok pixel, Marketing > TikTok): https://woocommerce.com/document/tiktok-for-woocommerce/
- TikTok plugin source, version 1.4.2 (inline scripts, page view as a
trackcall with an event ID): https://plugins.svn.wordpress.org/tiktok-for-business/trunk/pixel/Tt4b_Pixel_Class.php - TikTok plugin source, version 1.4.2 (form and button events, form plugin listeners): https://plugins.svn.wordpress.org/tiktok-for-business/trunk/admin/js/ajaxSnippet.js
- TikTok Business Help Center, Disconnect an e-commerce platform integration: https://ads.tiktok.com/resources/help/article/disconnect-integration
- PixelYourSite, TikTok Settings (PixelYourSite Pro > TikTok, pixel and Events API): https://www.pixelyoursite.com/docs/tiktok-settings-configuration
- SweetCode, Pixel Manager: TikTok (Tracking Pixels > TikTok, Events API in Pro with deduplication): https://sweetcode.com/docs/pmw/plugin-configuration/tiktok
- WordPress.org, WPCode (header and footer code): https://wordpress.org/plugins/insert-headers-and-footers/
- Elementor, Add Facebook Pixel to Elementor (Custom Code): https://elementor.com/help/how-to-add-facebook-pixel-to-elementor/
- Elegant Themes, How to use the Divi Integration tab: https://help.elegantthemes.com/en/articles/2734187-how-to-use-the-divi-integration-tab
- Site Kit by Google, Tag Manager (Let Site Kit place code on your site): https://sitekit.withgoogle.com/documentation/supported-services/tag-manager/
- WordPress.org, GTM4WP: https://wordpress.org/plugins/duracelltomi-google-tag-manager/
- TikTok Business Help Center, TikTok Pixel Helper: https://ads.tiktok.com/resources/help/article/tiktok-pixel-helper-2.0?lang=en
More TikTok guides
- TikTok Pixel fires before cookie consent on WordPress
- TikTok Pixel not firing after cookie consent on WordPress
- Repeated TikTok event IDs drop real conversions: how to fix
- TikTok Pixel event_id missing on WordPress and WooCommerce
- TikTok click ID (ttclid) lost on WordPress
- 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)