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

remove gtm_preview if not in preview mode #48

Closed
RobertHeim opened this issue Dec 5, 2019 · 1 comment · Fixed by RobertHeim/react-gtm#1 · May be fixed by #49
Closed

remove gtm_preview if not in preview mode #48

RobertHeim opened this issue Dec 5, 2019 · 1 comment · Fixed by RobertHeim/react-gtm#1 · May be fixed by #49

Comments

@RobertHeim
Copy link

In GTM we can select to only trigger an event in live environment. However, using react-gtm, this event would NOT fire in live environment - I think maybe because react-gtm always adds the gtm_preview parameter?

const gtm_preview = `&gtm_preview=${preview}`

Maybe we can check the paramter for being empty and and if so obmit the param:

const gtm_preview = !preview ? '' : `&gtm_preview=${preview}`
@mos-adebayo
Copy link

mos-adebayo commented Sep 29, 2020

These are valid fix and need to be merged. gtm_auth and gtm_preview are optional and should not be added to the URL when they are not set

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants