Skip to content

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

@ayeletcohen

Description

@ayeletcohen

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);
  };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions