1

When creating a Google Analytics tag, I'm left to choose either one of these:

enter image description here

But I want to track both Page views and Events. So, to accomplish that, I'm creating two tags, one for each Track Type: enter image description here

My question is, whether this is the correct approach. I'm concerned whether GTM is actually creating two tags with the potential to conflict each other.

2 Answers 2

2

I think the Tag Types are causing confusion for you. A Google Analytics tag is one that sends specific data to Google Analytics, not one that installs Google Analytics. The GTM code included on your website does the installation of GA as a byproduct of you having GA tags, and you use the individual tags and triggers to define the specific events, pageviews, and other hits you want to send to GA.

There are other tag types because GTM can be used for non-GA purposes as well, such as adding third party code other than GA, or your own extra HTML.

To send pageviews to GA, you'll want a tag with tag type Google Analytics and track type Page View, with a Page View trigger set to All Page Views. GTM will automatically extract and format the data GA needs from there. (With a more complicated setup, you might have multiple page view tags that are triggered by only certain page views, so that you can - for example - add Enhanced Ecommerce data to specific pageviews.)

For events, you'll likely want a different tag for every event you track. Every one of them would be tag type Google Analytics and track type Event, but they would have different values filled in for Category, Action, and Label, according to what specific event is being triggered. GTM uses those to put together the data correctly to send to GA.

For example, you might have an event tag that tracks clicks on a "More Information" link for your phone consultation service, where the data sent to GA is Category: Engagement, Action: More Information Click, and Label: Consultation. The setup to trigger that event can be entirely within GTM, with a trigger type of Click: Just Links, scoped in to Some Link Clicks, with the correct link specified in the filtration area that appears when you select Some Link Clicks. You can specify many things, such as which page it appears on and what CSS selector will pick out the correct link.

example tag configuration screenshot

example trigger configuration screenshot

Although I can't see your tag setup, the screenshot in your question shows a Custom Event trigger - a trigger that watches for an object of the form { 'event': 'customEventName' } to be pushed into the dataLayer. Assuming you have your JavaScript set up to trigger events in that way, you almost certainly still need separate tags for different custom events, or you will be sending identical Categories, Actions, and Labels for every kind of event.

On another note, your exclusion of Page Views in the Event tag is unnecessary, because that tag is only triggered by Custom Events and Custom Events do not include Page Views.

I hope that clarifies. For a little more, there's a decent introduction to how GTM works in Jeffalytics' Google Tag Manager Tutorial.

1
  • I think it's helpful to add that you can use variables in google tag manager, such that you could use one tag to forward all events. I don't believe it's necessary to use separate tags for each event.
    – nomadoda
    Jan 10, 2020 at 13:12
1

That is correct, two tags.. one to fire the pageviews and one for your event. You may find you end up creating further event tags, depending on your tracking/reporting needs.

2
  • Are you not surprised having to create two tags, when in reality it's the same tag (GA) being created twice. Or is GTM smart enough to only create the tag once, but track both pageviews and custom events?
    – Birowsky
    Oct 28, 2018 at 10:38
  • 1
    @Birowsky No. You better can assume GTM is not smart at all ;-) Actually it's info-in = info-out. So what you say to GTM to process and send, that is what you get. Some thing can be made smarter, or automatic, but in general, all need to be named separate. The hit type does tell GA how to process the data coming in and in what reports to put it in. So an page view gets processed differently than an event. Nov 13, 2018 at 14:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.