Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set tracking ID under config #46

Open
niyando opened this issue Jan 28, 2016 · 1 comment
Open

Set tracking ID under config #46

niyando opened this issue Jan 28, 2016 · 1 comment

Comments

@niyando
Copy link

niyando commented Jan 28, 2016

Not exactly an issue but something that would be great to have.

Using below

.config(function(AngularyticsProvider, ENV) {
  if(ENV.name === "production")
    AngularyticsProvider.setEventHandlers(['Console', 'GoogleUniversal']);
  else
    AngularyticsProvider.setEventHandlers('Console');
}).run(function(Angularytics) {
  Angularytics.init();
})

as expected, I am able to trigger events only in production mode. But now I also wish to log events in staging (pre-production) env under some different tracking ID UA-XXXXX-Y (to segregate data). I need to set tracking id conditionally for this. Is there a way to set this in above block instead of hardcoding it in html file?

If not, I would be happy to contribute.
Thanks for this awesome utility 👍

@GQuantrill
Copy link

GQuantrill commented May 3, 2017

You can do this using lookup tables from within Google Tab Manager. I have UA-xxx-1 for pre-prod and the UA-xxxx-2 for all things production.
You then alter the events and pageview triggers to use the lookup table to determine which tag to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants