mzuccaroli / angular-google-tag-manager

A service library for integrate google tag manager in your angular project
https://itnext.io/how-to-add-google-tag-manager-to-an-angular-application-fc68624386e2
MIT License
136 stars 78 forks source link

Console exception when loading GTM using the library #182

Open imsdjeb opened 1 year ago

imsdjeb commented 1 year ago

Error:

image

Code:

image

Scenario:

& when I open the app on the browser I'm having this exception each time I navigate in a new page.

BojanKogoj commented 1 year ago

This can happen for multiple reasons, in my case when browser/extensions block gtm.js from loading.

To avoid the error, I simply caught the error

this.gtmService.pushTag(gtmTag).catch(() => {});