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

More configuration options when initializing ga

Open Soulou opened this issue 8 years ago • 3 comments

I needed to add more configuration statements in my Analytics initialization, so here is my implementation

ENV.googleAnalytics = {
      webPropertyId: process.env.GOOGLE_ANALYTICS_ID,
      extraCreateParams: {"allowLinker": true},
      extraRequires: ["linker"],
      extraStatements: [{
        action: "linker:autoLink",
        args: ["arg1", {arg2: val2}]
      }]
};

Will result in

ga('create', 'token', 'auto', {"allowLinker":true});
ga('require', 'linker');
ga('linker:autoLink', 'arg1', {arg2: val2});

Everything is compatible with the existing code

Soulou avatar May 18 '16 17:05 Soulou

👍

piotrekbator avatar Jun 30 '16 11:06 piotrekbator

Would love to use this lib but need the linker statement. +1

lucasgray avatar Sep 02 '16 18:09 lucasgray

Hi, How do I set domain name for GA.Kindly can one help me . _gaq.push(['_setDomainName', 'example.com']);

Thanks, Rekha

Rekhajikki avatar Apr 10 '17 12:04 Rekhajikki