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

  1. Log out of WordPress or use a private (incognito) window: some tracking plugins skip logged-in administrators.
  2. Open developer tools (F12), go to Network and filter by analytics.tiktok.com/api/v2/pixel.
  3. Load the page and accept cookies.
  4. In each request’s payload, event is the event name and context.pixel.code is 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”.
  5. On a WooCommerce store, click Add to cart on a product: AddToCart should 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

  1. List every place the pixel can come from. Right-click the page, choose View page source and search for analytics.tiktok.com and ttq.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-header and tiktok-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.php file;
    • your Google Tag Manager (GTM) container, and how GTM itself is added (Site Kit by Google, GTM4WP or a snippet).
  2. 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.
  3. 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 with ttq.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.
  4. 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 with ttq.page(). If both are on the page, every page view is counted twice, and the two do not share an ID.
  5. Check the plugin’s form events. TikTok’s plugin also sends events for forms on its own: Contact or SubmitForm when 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), and ClickButton on 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 sends Lead for the same form, you get more. Test each form and keep one sender.
  6. 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.
  7. Check GTM for overlapping tags, for example a lead tag on a form trigger and another on the thank-you page.
  8. 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

  1. 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.
  2. Re-run the check on IsPixelWorking. The issue should be gone.

Sources

More TikTok guides