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

Universal Analytics Creates A Named Tracker by Default #116

Open
rcollette opened this issue Aug 24, 2018 · 1 comment
Open

Universal Analytics Creates A Named Tracker by Default #116

rcollette opened this issue Aug 24, 2018 · 1 comment

Comments

@rcollette
Copy link

rcollette commented Aug 24, 2018

What I'm seeing at the moment is that a named tracker is created by default. I'm not doing anything to set a named tracker anywhere, I don't make any ga() call in my code. I'm merely including the tracking code.

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=MY-ACCOUNT-ID"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'MY-ACCOUNT-ID');
</script>

What I see when the app loads is

Running command: ga("create", "MY-ACCOUNT-ID", {cookieDomain: "auto", name: "gtag_my_account_id"})

Note that the tracker name created is gtag_my_account_id. This is done in line 4049 of the gtag code (after formatting in chrome).

f = "gtag_" + c.split("-").join("_")

I have to call

$analyticsProvider.settings.ga.additionalAccountNames = ['gtag_my_account_id'];

For any of the tracking events to show show up in google analytics.

The problem is that there are redundant calls being made to the default tracker as well, which simply go into thin air.

Running command: ga("send", {hitType: "pageview", page: "/home"})
   Command ignored. Unknown target: undefined
Running command: ga("gtag_my_account_id.send", {hitType: "pageview", page: "/home"})

If in fact the default tracker is no longer the t0 one and an account specific one is used, then the plug-in should probably be updated to handle this.

If not everyone is seeing this behavior, then it would seem that we need some way of setting the default account name to use.

I'm OK with submitting a PR for this but I need more input on what others are seeing for behavior

@ssohal
Copy link

ssohal commented Jan 15, 2019

I'm seeing the exact same behavior.

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