Help removing duplicate FB pixel in theme code

Topic summary

A user is experiencing issues with a duplicate Facebook pixel appearing on their Shopify store’s rendered page, despite being unable to locate the code through theme file searches using Visual Studio Code or the ‘One-Click Code Search’ app.

Key Questions:

  • Whether pixels installed via Conversion API (cAPI)/Trekkie should display separately or together
  • If the pixel might be injected automatically through other means

Code Evidence:
The user provided a web-pixels-manager-setup script snippet showing Facebook pixel configuration with ID “764188222288213” and metadata indicating “facebook_pixel” type with “meta_app_system_user_token”.

Troubleshooting Steps Suggested:

  • Check if the Facebook & Instagram app is installed in the Shopify store, as this is a likely source of the pixel connection
  • Verify the ‘Manage Pixels’ section under ‘Customer Events’ in store settings for any custom pixels
  • Inspect network requests and the initiator tree to identify the pixel’s source

Current Status:
The discussion remains open with the helper requesting store access to analyze the configuration further. The store URL was shared: www.thehotelsheet.co.nz.

Summarized with AI on November 7. AI used: claude-sonnet-4-5-20250929.

Hi There,

We’re seeing another FB pixel loading on the rendered page but can’t find the code after searching all theme files via Visual Code (locally) and via the ‘One-Click Code Search’ app.

If installed via cAPI/Trekkie, should the pixel also display or is it one or the other?

If it shouldn’t be appearing, is it possible the pixel is being injected automatically via some other means and if so, how do we locate and delete?

See below for what we see in addition to the cAPI/Trekkie code.

Any help much appreciated.

Cheers, Ben

<script id="web-pixels-manager-setup">(function e(e,n,a,t,r){var o="function"==typeof BigInt&&-1!==BigInt.toString().indexOf("[native code]")?"modern":"legacy";window.Shopify=window.Shopify||{};var i=window.Shopify;i.analytics=i.analytics||{};var s=i.analytics;s.replayQueue=[],s.publish=function(e,n,a){return s.replayQueue.push([e,n,a]),!0};try{self.performance.mark("wpm:start")}catch(e){}var l=[a,"/wpm","/b",r,o.substring(0,1),".js"].join("");!function(e){var n=e.src,a=e.async,t=void 0===a||a,r=e.onload,o=e.onerror,i=document.createElement("script"),s=document.head,l=document.body;i.async=t,i.src=n,r&&i.addEventListener("load",r),o&&i.addEventListener("error",o),s?s.appendChild(i):l?l.appendChild(i):console.error("Did not find a head or body element to append the script")}({src:l,async:!0,onload:function(){var a=window.webPixelsManager.init(e);n(a);var t=window.Shopify.analytics;t.replayQueue.forEach((function(e){var n=e[0],t=e[1],r=e[2];a.publishCustomEvent(n,t,r)})),t.replayQueue=[],t.publish=a.publishCustomEvent,t.visitor=a.visitor},onerror:function(){var n=e.storefrontBaseUrl.replace(/\/$/,""),a="".concat(n,"/.well-known/shopify/monorail/unstable/produce_batch"),r=JSON.stringify({metadata:{event_sent_at_ms:(new Date).getTime()},events:[{schema_id:"web_pixels_manager_load/3.1",payload:{version:t||"latest",bundle_target:o,page_url:self.location.href,status:"failed",surface:e.surface,error_msg:"".concat(l," has failed to load")},metadata:{event_created_at_ms:(new Date).getTime()}}]});try{if(self.navigator.sendBeacon.bind(self.navigator)(a,r))return!0}catch(e){}var i=new XMLHttpRequest;try{return i.open("POST",a,!0),i.setRequestHeader("Content-Type","text/plain"),i.send(r),!0}catch(e){console&&console.warn&&console.warn("[Web Pixels Manager] Got an unhandled error while logging a load error.")}return!1}})})({shopId: 24050979,storefrontBaseUrl: "https://www.thehotelsheet.co.nz",extensionsBaseUrl: "https://extensions.shopifycdn.com/cdn/shopifycloud/web-pixels-manager",surface: "storefront-renderer",enabledBetaFlags: ["5de24938","4735909c"],webPixelsConfigList: [{"id":"322076946","configuration":"{\"pixel_id\":\"4671872222888123\",\"pixel_type\":\"facebook_pixel\",\"metaapp_system_user_token\":\"-\"}","eventPayloadVersion":"v1","runtimeContext":"OPEN","scriptVersion":"8b3843af2d71780cfb83fdde884ce168","type":"APP","apiClientId":2329312,"privacyPurposes":["ANALYTICS","MARKETING","SALE_OF_DATA"]},{"id":"shopify-app-pixel","configuration":"{}","eventPayloadVersion":"v1","runtimeContext":"STRICT","scriptVersion":"0142","apiClientId":"shopify-pixel","type":"APP","privacyPurposes":["ANALYTICS","MARKETING"]},{"id":"shopify-custom-pixel","eventPayloadVersion":"v1","runtimeContext":"LAX","scriptVersion":"0142","apiClientId":"shopify-pixel","type":"CUSTOM","privacyPurposes":["ANALYTICS","MARKETING"]}],initData: {"shop":{"name":"The Hotel Sheet","paymentSettings":{"currencyCode":"NZD"},"myshopifyDomain":"thehotelsheet-com.myshopify.com","countryCode":"NZ","storefrontUrl":"https:\/\/www.thehotelsheet.co.nz"},"customer":null,"cart":null,"checkout":null,"productVariants":[]},},function pageEvents(webPixelsManagerAPI) {webPixelsManagerAPI.publish("page_viewed", {});},"https://www.thehotelsheet.co.nz/cdn","d8ce7c9407b506dba59bed2e02f0a514e9e9bf1a","0bfd3999w8a9142d8pdfaacbf8m94fbe030",);</script> <script>window.ShopifyAnalytics = window.ShopifyAnalytics || {};

HI @Ben31 ,

I’d be happy to help you out. To better understand the issue, could you please share the store URL with me? This will allow me to inspect the network request and analyze the initiator tree to get a clearer picture of the situation.

Kind Regards,
Roy

Thanks for the reply, our site is: www.thehotelsheet.co.nz

Cheers, Ben

Thank you for your patience.

After reviewing the code, I found that Facebook Pixel is indeed configured.

To troubleshoot further, could you please check if the Facebook & Instagram app is installed in your store? It’s likely that the account is connected through this app.

Additionally, you may want to verify if any custom pixels have been added in the ‘Customer Events’ section under 'Manage Pixels’ in your settings. This will help us identify the source of the connection.

Kind Regards,
Roy