revolunet / angular-google-analytics

Google Analytics tracking for your AngularJS apps
MIT License
652 stars 179 forks source link

Google Optimize Integration #214

Closed SaschaFitzner closed 6 years ago

SaschaFitzner commented 6 years ago

Hello, I want integrate Google Optimize. Normaly, the following code snipped must be added. Its possible with the angular-google-analytics package?

ga('require', 'GTM-1234567');

Thank you and kind regards,

Sascha

SaschaFitzner commented 6 years ago

Its easy, with the following code in an controller, it works:

$rootScope.$on('$viewContentLoaded', () => { $window.ga('require', 'GTM-1234567'); });