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

Multiple GA tacking codes #217

Closed
elefante opened this issue Feb 15, 2019 · 2 comments
Closed

Multiple GA tacking codes #217

elefante opened this issue Feb 15, 2019 · 2 comments

Comments

@elefante
Copy link

elefante commented Feb 15, 2019

Some times It's useful to send data to multiple GA accounts from a single site. Maybe parts of this site is managed by different teams, and have different GA accounts.

The GA documentation says that one of them must have a name:

ga('create', 'UA-XXXXX-Y', 'auto');
ga('create', 'UA-XXXXX-Z', 'auto', 'clientTracker');

Is it possible implement this using ember-metrics?

Great addon, thank you!

@Leooo
Copy link
Contributor

Leooo commented Jul 1, 2020

To make it work, should allow a fourth optional parameter coming from config in https://github.com/MelSumner/ember-metrics/blob/master/addon/metrics-adapters/google-analytics.js#L42

And also optionally override https://github.com/MelSumner/ember-metrics/blob/master/addon/metrics-adapters/google-analytics.js#L99 and https://github.com/MelSumner/ember-metrics/blob/master/addon/metrics-adapters/google-analytics.js#L83 fromt he same config param as per https://developers.google.com/analytics/devguides/collection/analyticsjs/creating-trackers#working_with_multiple_trackers

Then using different config for each metricsAdapter instance should work.

In our case, to split analytics across engines, we reinstantiate metricsAdapters in an instance-initializer

I'll give it a go

@jherdman
Copy link
Contributor

Resolved by #269

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

3 participants