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

Infinite tag triggering given a single dataLayer push #48

Closed
robertvb opened this issue Dec 29, 2020 · 1 comment
Closed

Infinite tag triggering given a single dataLayer push #48

robertvb opened this issue Dec 29, 2020 · 1 comment

Comments

@robertvb
Copy link

Hi guys, thanks for the library. Appreciated.

I have this snippet that I am sure is being called only once:

sendAnalytics(text: string) { console.log("calling GTM push") const gtmTag = { event: 'user_search', text: text, } this.gtmService.pushTag(gtmTag) }

Being 'text' a custom data layer variable previously defined in GTM.

Then, I have created a custom HTML tag:

<script> console.log("CUSTOM HTML text value: " + {{text}}) gtag('event', 'user_search', {'event_label': {{text}} }); fbq('track', 'user_search'); </script>

With a custom trigger for events containing 'user_search'.

Then, I can see the custom HTML code is being called thousand times before crashing and this.gtmService.pushTag is only called once.

I believe is a quite simple config and I assume it should be only called once.

Could you help?

Thanks.

@mzuccaroli
Copy link
Owner

i think this problem is caused by your GTM configuration, the custom gtm tag it's not strictly related to the library

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

No branches or pull requests

2 participants