I am attempting to set up two analytics trackers in my Angular App. One of my requirements is to set up a tracker for every user that logs in to the app that forwards page tracking and event data to a static tracker known at config time. However, the second tracker needs to be set during runtime once a user is logged in. It needs to send analytics data to a tracker that is associated with their account.
I am new to using google analytics and thought it would be as easy as pushing to the ga command queue to trackers but after reading the analytics developer literature it seems that I would have to explicitly send page track commands to both trackers.
So instead of re-inventing the wheel I looked at revolunet/angular-google-analytics hoping that it would solve my problem. However, it complains about not setting the tracker at run-time. I tried using
then mutating the array
at runtime but it seems to produce no effect.
If anyone has had experience with this in the past please let me know, i'm looking for a clean Angular-ish solution besides putting a wrapper around the ga command queue unless that's my best bet.