Google analytics beginner here.
I'm developing a new way to capture custom dimensions for my team's site, and I want to know if there's anything that looks wrong with my setup.
In Google Tag Manager, I have two Google Analytic Tags
- Custom HTML with a Google Analytic HTML+JavaScript code. Triggered by "All pages" (page view).
- Universal Analytics Tag. It's linked to a Google Analytics variable which contains the UA and some custom dimensions. I created this new tag because I can't use
dataLayer
with the Custom HTML tag that was already added. The tracking type isevent
, and I want to know if I have to change it topage view
. Also the trigger is a custom event that I trigger from the page with Javascript usingdataLayer
.
I'm concerned about a few things.
- Is the tracking type correct as
event
for the second tag? - Will having two tags somehow mess up my data?
- Will having two tags make the custom dimensions data be stored separately? I want somehow to store the custom dimensions as if they were associated with the page view (although this way of thinking might not make sense, I'm not sure, after all I can create reports and they represent the views statistics).
I'm using this code in the HTML page.
var dataLayer = window.dataLayer || [];
dataLayer.push({
"event": "details-analytics",
ga_author_id: 4858,
ga_profile_type: 2,
ga_post_id: 830906
});
I already verified that the second tag isn't triggering additional pageviews, as they are counted as 1 in the real time widget.
To summarize, I'd have preferred that the first tag was a Universal Analytics tag that could be configured with custom dimensions, so I could use the same tag for both page views and adding custom dimensions only for the page I need them to have them. But since it was a custom HTML tag I decided to add a new one. Is my setup of 2 tags equivalent to having 1 as I just described? or is there something that would be a bit off?
There are many things I don't understand about Google Analytics and I prefer to get a quick opinion rather than learn by myself (I don't have time at all).