Install Google Tag Manager (gtm) to Angular app


I tried to install GTM to an Angular app by adding the script to the head and the iframe to the body in the index.html file.

I load the app in Chrome an I can see that are added in the html.

The Google Tag Assistant plugin from Chrome detects it well but when I go to the Network tab I can’t see any gtm.js request and also I type in the console google_tag_manager and I get google_tag_manager is not defined.

I tried the plugin angular-google-tag-manager but happens the same.

I don’t know what’s going on, any guess?


I found what was going on.

I had an script for the cookies of my app and I guess is using gtm or analytics and commenting that script solved the problem. I also tried changing the order of the scripts and also solved the problem, first my gtm script and after the cookies script which was causing the problem.

Answered By – Alex

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published