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

Push values into the data layer #170

Closed ghost closed 1 year ago

ghost commented 1 year ago

Hello, I would like to add a custom dimension to Google Analytics. According to some tutorials, before I get a custom dimension in GA4, I have to push it by the data layer in GTM (for example here is described how to do that https://mixedanalytics.com/blog/ga-gtm-datalayer-custom-dimensions/).

I use angular-google-tag-manager in my implementation, is there any way to push value to the data layer in this implementation?

Best Regards

ghost commented 1 year ago

I investigated and found that google-tag-manager-service provides access to the data layer. this.googleTagManagerService.getDataLayer()

I'm closing the issue.