Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Tag Manager dataLayer fix #179

Closed
wants to merge 3 commits into from

Conversation

bugduino
Copy link

According to the GTM dev guide (https://developers.google.com/tag-manager/devguide) the dataLayer should be set as a global variable and Google will be in charge of retriving such variable with their gtm.js iframe.

Fixes #127

According to the GTM dev guide (https://developers.google.com/tag-manager/devguide) the dataLayer should be
set as a global variable and Google will be in charge of retriving such
variable with their gtm.js iframe.

Fixes adopted-ember-addons#127
…aLayerProp name for google tag manager adapter
@hernanvicente
Copy link

Hi, first than all thanks for this excelent addon, right now we are trying to start using GTM and we are asking us if is there a way to have mixed the #179 soon or it will be better to use directly the @bugduino fork ? Thanks a lot again!

@MilkyWayJoe
Copy link

is this going to be merged eventually?

@tpetrone
Copy link

tpetrone commented Sep 27, 2018

Any chance to see this incorporated?
@bugduino would you mind rebasing?

@bugduino
Copy link
Author

Rebased through github interface so needs a test but seems ok now

@bugduino bugduino closed this Sep 30, 2018
@bugduino bugduino reopened this Sep 30, 2018
const envParamsString = envParams ? `&${envParams}`: '';

assert(`[ember-metrics] You must pass a valid \`id\` to the ${this.toString()} adapter`, id);

set(this, 'dataLayer', dataLayer);
window[dataLayerProp] = dataLayerValue;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bugduino I'm new to this but I've just noticed that it seems like you should not use the window if you are not sure you canUseDom. I would suggest to move it down a bit (put it below the canUseDom) to prevent unseen problems.

@jherdman jherdman closed this Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Google Tag Manager not loading when you specify a data layer in the config
6 participants