ember-cli-google-analytics icon indicating copy to clipboard operation
ember-cli-google-analytics copied to clipboard

Add configuration object to ga('send')?

Open janwerkhoven opened this issue 10 years ago • 3 comments

Is this possible to add a configuration object to the GA tracker??

We track multiple apps and need tofilter the data per app like below:

ga('send', 'screenview', {
  'appName': 'myAppName',
  'appId': 'myAppId',
  'appVersion': '1.0',
  'appInstallerId': 'myInstallerId',
  'screenName': 'my overridden screen name'
});

More details https://developers.google.com/analytics/devguides/collection/analyticsjs/screens

Is this possible?

PS: love your package, integrates nicely.

janwerkhoven avatar Sep 21 '15 07:09 janwerkhoven

Same feature as in #7, right?

givanse avatar Sep 21 '15 12:09 givanse

In your README.md you use the following example:

import Ember from 'ember';
import config from './config/environment';
import googlePageview from './mixins/google-pageview';

var Router = Ember.Router.extend(googlePageview, {
  location: config.locationType
});

Router.map(function() {
  ...
});

export default Router;

Can I safely overwrite pageview to screenview and add my custom variables like below??

var Router = Ember.Router.extend(googlePageview, {
  location: config.locationType,
  notifyGoogleAnalytics: function() {
    return ga('send', 'screenview', {
      'appName': 'bookings',
      'appId': 'new',
      'appVersion': '1.0',
      'screenName': this.get('url')
    });
  }.on('didTransition')
});

janwerkhoven avatar Sep 22 '15 00:09 janwerkhoven

+1

Wondering the same, we use custom dimensions it'd be great to push them along with the pageviews.

hergaiety avatar Nov 30 '15 20:11 hergaiety