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 adapter settings that depends on current route #134

Open
PoslinskiNet opened this issue Apr 28, 2017 · 2 comments
Open

Multiple adapter settings that depends on current route #134

PoslinskiNet opened this issue Apr 28, 2017 · 2 comments

Comments

@PoslinskiNet
Copy link

We've got to the point where across single application we need to use the same adapter with 2 different configurations. Is there any way to achieve it without extending ember-metrics API, so I can use for example ember-metrics with GoogleAnalytics adapter with 1 config on some specific routes and with another on all other (the whole app will have one config except few routes). The problem is that if I've 2 Google Analytic adapters, only the first one is tracking data (even if 2 of them are initialized).

Issue seem to be connected to #91

Thanks in advance for any help.

@poteto
Copy link
Collaborator

poteto commented May 12, 2017

I think the solution here is to:

  • Let the consuming application give the instantiated adapter a name (default name would be the adapter's name)

  • Let you call specific adapters by their name (already possible):

      metrics.trackEvent('GoogleAnalyticsA', {
        title: 'config A'
      });
      metrics.trackEvent('GoogleAnalyticsB', {
        title: 'config B'
      });
    

What do you think?

@PoslinskiNet
Copy link
Author

Hello @poteto,

I'm not sure this will address the same issue we had. Basically, we want to deactivate specific GA adapter for the given ID and turn on the other one. All of this is related to the current path in the application. So basically, we one tracking in few routes and some other in another route.

The data on another route shouldn't be tracked for one of the adapters.

Do you think that there is any build in an option that allows for that? For that case, I've prepared with @mikoscz the draft of the solution #136.

Please, let me know what are your thoughts.

Thanks in advance.

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