Google Tag Manager needs Jquery

nachogarcia
0
nachogarcia
commented 6 months ago

Version

latest

Steps to reproduce

Install the module, add the ID and start the app.

What is expected ?

The module works properly

What is actually happening?

It breaks because it needs Jquery

VM9248:1 Uncaught ReferenceError: jQuery is not defined
    at sender (<anonymous>:1:37)
    at <anonymous>:1:316
    at gtm.js?id=GTM-******&l=dataLayer:4683
    at c (gtm.js?id=GTM-******&l=dataLayer:4685)
    at Ab (gtm.js?id=GTM-******&l=dataLayer:4487)
    at e (gtm.js?id=GTM-******&l=dataLayer:4531)
    at gtm.js?id=GTM-******&l=dataLayer:4476
    at Array.<anonymous> (gtm.js?id=GTM-******&l=dataLayer:4532)
    at Object.bg (gtm.js?id=GTM-******&l=dataLayer:4531)
    at Oe (gtm.js?id=GTM-******&l=dataLayer:4532)

Looks like GTM needs jQuery to work. Maybe we should put it as a peer dependency.

Additional comments?

I'm also using https://github.com/nuxt-community/analytics-module and it works flawlessly.

bug
0
nachogarcia
0
nachogarcia
commented 6 months ago

I think GTM does not need jQuery, it's just that they also included a jQuery license because part of their code is very similar to it.
Looks like my client is injecting some code in the tag that needs jQuery and that is the cause of the issue.
Will look into it, and if the problem continues I would reopen the issue.

0
federicovezzoli
10
federicovezzoli
commented 4 months ago

I have the same issue:
https://blabstudiostighidi.netlify.com/

Don't have jquery installed and not planning to do it.
Any help?

thanks!

0
Informations
Bug Report โ€ข Open
#c175 - Created 6 months ago