Do I need jQuery for Google Tag Manager to work? Using it with AngularJs

2.3k views Asked by At

I can't seem to find any answers on this. I've got an AngularJs application, which I do not need jQuery for. I've added Google Tag Manager using Angulartics but I'm getting a 'jQuery is not defined' error in the console. Do I need to include jQuery just for GTM? Since jQuery is no longer so much of a standard this surprises me? And it's vaguely annoying! Anyone know a way around it or can I just ignore the error and everything will work anyway?

2

There are 2 answers

1
Eike Pierstorff On BEST ANSWER

No, you do not need jQuery.

The only relation between jQuery and GTM that I know of is that the code of the built-in selector engine so much resembled jQuery that Google agreed to add a jQuery copyright notice (at least that is what Simo Ahava told in one of his GTM trainings, and he is a Google Certified Expert for GTM, so I guess he has more insights than us).

But GTM does not require jQuery to work (that's sort of the point of having a built-in selector engine), and if you are seeing jQuery-related errors they come from a tag inside GTM that requires jQuery than from GTM itself (or, if you load marketing tags, they might in turn load something else that requires jQuery).

1
jeancallisti On