I happen to be working on converting our GA code from analytics.js to GTM, and I just discovered: the way this is set up is double-counting traffic. I'm getting two calls to GA for each pageview. You can see it by using the Google Analytics debugger extension in Chrome. Here's a screenshot:
Our GA code has already executed before this -- and as you can see, the way the GA code is firing when your hidden code gets executed, it's re-firing the previous call as well.
The problem is, we can't just use the built-in GA form where we just put in the GA account number, as we have this set up as a subdomain and we need to pass in things like Channel and other custom vars we have set up in GA. Otherwise we can't tell the homepage of our Forums from the homepage of our main website when looking at the path in GA. Here's what our GA code looks like:
ga('create', 'UA-XXXXXX-XX', 'cigaraficionado.com');
ga('require', 'linkid', 'linkid.js');
Is there a way to modify or disable the auto-call that your built-in code does? I think it's because it's doing the GA.getAll part, and that's re-calling the GA tag we've already created.
Alternatively, I'm wondering if perhaps I should just modify our ga code so that last line just does a 'set' instead of a 'send' -- and then let your master getAll do the sending part. Although I'm not 100% sure that it will send along the variables we're setting this way, as it doesn't seem to be doing that with the second GA call on the page. Your thoughts?