How to Run a Self-Service Scan
for Old Pixel Code
Use this page to find duplicate or outdated Meta pixel installs, check the most common hiding places, and remove extra code carefully without breaking the setup you still need.
Summary
What this page covers
If your site has more than one Meta pixel firing, or if old Facebook tracking code is still sitting in your theme, tag manager, or checkout scripts, attribution and event quality can get messy fast.
This page is a draft diagnostic guide for marketers and store owners who want to run a first-pass scan themselves before handing the issue to a developer. It is written Shopify-first, but the same process is still useful if you are scanning code files, CMS templates, or Google Tag Manager on a non-Shopify site. The goal is to help you identify what counts as old pixel code, where it typically lives, and how to disable it safely enough to validate whether you found the real source of the duplicate tracking.
Signals
What you're looking for
The objective is not just to find "a pixel." It is to find extra, outdated, or manually installed code that is loading in addition to the version you actually want to keep.
Common clues
- More than one pixel appears in Meta Pixel Helper on the same page load.
- A single pixel appears to fire the same event more than once.
- You find hard-coded Facebook or Meta scripts in files, settings, or tag-manager tags.
- You discover an old custom pixel that was never removed after a platform or app change.
Code patterns to search for
fbqconnect.facebook.netfbevents.jsFB.init- "Meta Pixel", "Facebook Pixel", or an old pixel ID you recognize
If you do find any of these code patterns, or if you see activity in Meta Pixel Helper, look for the pixel ID being used and compare it against the live pixel ID in your Meta account that is tied to your active ad campaigns.
Example code snippets
These are common patterns that often reveal an older manual Meta or Facebook pixel install:
<script>
!function(f,b,e,v,n,t,s){
if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)
}(window, document,'script','https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '123456789012345');
fbq('track', 'PageView');
</script>
<script async defer crossorigin="anonymous"
src="https://connect.facebook.net/en_US/sdk.js"></script>
Locations
Where you are looking
Shopify
- Active theme code: especially
theme.liquid,header,footer, or snippets that were added manually. - Settings → Checkout: look for old code in Additional Scripts or related checkout fields.
- Settings → Customer events: check for custom pixels that may still be connected.
- Facebook & Instagram sales channel: check whether an active connection there may be loading pixel activity on the store.
Website code
- Search the codebase for the Meta/Facebook patterns listed above.
- Review page source on the live site for scripts that load from Facebook domains.
- Check any custom template includes, shared layout files, or script managers that load globally.
Google Tag Manager
- Confirm whether GTM is installed on the live site and note the active container ID.
- Use GTM search to look for terms like
Meta,Facebook,Pixel,fbq, or a known pixel ID. - Review matching Tags and the Triggers attached to them so you can identify which ones are likely responsible for page-load or event activity.
- Check whether paused, unpublished, or legacy tags were recently reintroduced in the latest workspace version.
In practice, duplicate installs often come from one active integration plus one leftover manual install in theme code or GTM.
Action Plan
What to do when you find something
-
Back up first.
Copy and paste any code you are about to change into a safe backup note or document first. Duplicate your Shopify theme, export GTM changes, or otherwise make sure you can roll back. Do not edit production code without a recovery path.
-
Identify the suspected extra install.
Use the pixel ID, file location, GTM tag name, or script pattern you found to isolate the code block or tag that looks unwanted.
-
Disable or comment out the extra code before deleting it.
Pause GTM tags first. In code, comment out the suspected block before deleting anything. This makes your test easier to interpret and your rollback easier to manage.
-
Run tests immediately after each change.
Reload the site, run Meta Pixel Helper again, and confirm whether the duplicate pixel or duplicate event firing disappears. If GTM is involved, confirm whether the suspect tag is still firing. Use a private window when possible to reduce caching noise.
-
Validate that the change held.
Check that one pixel still loads, confirm GTM is no longer triggering the removed tag if relevant, and then come back 24 hours later to review event volumes in Meta Events Manager.
-
Delete only after validation, then document what changed.
Once the commented-out code or paused tag has been validated as unnecessary, remove it cleanly and keep a simple record of which file, setting, or GTM tag you touched so the next person does not reinstall the same code later.
Notes
Notes / disclaimers
- This page is a self-service guide, not a guarantee that every duplicate install can be found without developer help.
- Older Shopify setups may contain pixel code in more than one place at the same time.
- Some tracking problems are duplicate browser pixels; others are browser plus server duplication, which should be diagnosed separately.
- If you are not comfortable editing theme code or GTM, stop at the detection step and hand the findings to a technical resource.