How can I locate and remove old Google Ads tracking code?

How can I locate and remove old Google Ads tracking code?

ivan93
Visitor
1 0 0

Hi! I need delete google ads tracking for all pages, but I can't find where add this script. I check all theme files and checkout code. Can you help me find where add this code?

 

https://prnt.sc/lwt2qv_sxuX8

 

Me need delete only google ads tracking, because they add for all site. Corect code I add in code checkout, this old code for all site I need delete


This two code:

 

Reply 1 (1)

SB_90
Shopify Partner
216 52 70

Hi @ivan93 

 

This is all coming from a file called pixel.js.

 

Presumably, it was some kind of app install that added this file.

 

In turn, pixel.js is loaded by another file which looks like it's something to do with Hubspot cookie consent?

 

Section of the file in question that loads pixel.js is here:

 

  window._hsp.push(["addPrivacyConsentListener", function (consent) {
    if (consent.categories.advertisement) {
      if (!config) {
        fetchConfig({
          jsonUrl: `${configDomain}/hs-script-loader-public/v1/config/pixel/json`,
          jsonpUrl: `${configDomain}/hs-script-loader-public/v1/config/pixel/jsonp`
        }, cfg => {
          config = cfg;
          addPixels(cfg, utk);
        }, 'addPixels');
      } else {
        reinstallPixels(config, utk);
      }
    } else if (config) {
      disablePixels(config);
    }
  }]);

  window._hsq = window._hsq || [];

 

Without seeing the backend of the store it's difficult to know exactly what's happening but may at least give you a starting point!