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

Add support for multiple GA trackers #68

Closed
mattstratton opened this issue Mar 4, 2016 · 3 comments
Closed

Add support for multiple GA trackers #68

mattstratton opened this issue Mar 4, 2016 · 3 comments

Comments

@mattstratton
Copy link
Member

https://developers.google.com/analytics/devguides/collection/analyticsjs/creating-trackers#specifying_fields_at_creation_time

The idea here is that the main DOD tracker code will always be inserted, and events can add their own in the config file for the event, which would be added if it exists.

@mattstratton
Copy link
Member Author

// Standard code. Replace X's and domain with your own
ga('create', 'UA-XXXXXXXX-X', 'domain.com');

// Replace Y's with your account number. "b" can be anything you want.
ga('create', 'UA-YYYYYYYY-Y', {'name':'b'});

// Standard code. No change necessary.
ga('send', 'pageview');

// "b" can again be anything you want, but it MUST match "b" above.
ga('b.send', 'pageview');

@mattstratton
Copy link
Member Author

Also, this is the standard tracking code stuff:

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-45939822-1', 'auto');
  ga('send', 'pageview');

</script>

@mattstratton
Copy link
Member Author

I'm not sold this is actually working right now :)

@mattstratton mattstratton added this to the Future Enhancements milestone Apr 11, 2016
benjohnson77 pushed a commit to benjohnson77/devopsdays-web that referenced this issue May 22, 2016
yvovandoorn pushed a commit that referenced this issue May 22, 2016
yvovandoorn pushed a commit that referenced this issue May 22, 2016
yvovandoorn pushed a commit that referenced this issue May 29, 2016
yvovandoorn pushed a commit that referenced this issue May 29, 2016
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

1 participant