analytics.js-integrations icon indicating copy to clipboard operation
analytics.js-integrations copied to clipboard

Conflict between `analytics.js-integration-google-adwords-new` and `analytics.js-integration-google-analytics-4`

Open ayeletcohen opened this issue 3 years ago • 0 comments
trafficstars

When using both integrations on the same website, they override each other's window.gtag, so the latter loaded script will override the first one, and the events of the first one will not be reported to the destination.

From analytics.js-integration-google-analytics-4/lib/index.js:

window.gtag = function () {
        window.ga4DataLayer.push(arguments);
    };

From analytics.js-integration-google-adwords-new/lib/index.js:

window.gtag = function() {
    window.dataLayer.push(arguments);
  };

ayeletcohen avatar Jul 18 '22 08:07 ayeletcohen