The Portland Google Analytics User Group meetup in January at ISITE Design discussed adding Auto Event tracking without code. This deck includes some scenarios that were explored in the interactive lab exercises.
4. Auto Event Tracking
GTM can listen for click events so you don’t have to put code on every interaction. This
example tracks links to email addresses on your site.
This tag has a rule to fire
on all page, and simply
listens for clicks. When a
click occurs it sets a
dataLayer event
gtm.click
This macro gets the URL
from an element at sets
it as clickedLinkURL
5. This rule states that a
tag will fire if the
clickedLinkURL contains
“mailto” and the event
contains “gtm.click”
When a link with “mailto” in the
href is clicked it sends this tag
with a GA event containing the
mailto url as the event action
6. Useful QA and Debugging Tools:
• Google Analytics Debug
https://chrome.google.com/webstore/detail/google-analytics-debugger/jnkmfdileelhofjcijamephohjechhna?hl=en
• Google Analytics Tag Assistant
https://chrome.google.com/webstore/detail/tag-assistant-by-google/kejbdjndbnbjgmefkgdddjlbokphdefk?hl=en
• Fiddler (PC)
http://fiddler2.com/
• Charles (Mac)
http://www.charlesproxy.com/
7. Preview and Test GTM
Previewing (Web)
Google Tag Manager provides you with a preview link. You can share this link with others and when
they use it, a preview cookie will be set that enables preview mode just for their browser. When
they use the link to navigate to the website, the site will fire the tags in the version they are
previewing. Turn off the preview from the Container Versions page (Versions > All Versions in the
left navigation).
You can preview any version of a container. A version is essentially a saved snapshot of the
container.
Debug Console (Web only)
Debugging is a Preview mode option. When you preview a site and debugging is enabled, a console
window at the bottom of your browser shows the status of each tag (for example, fired, not fired)
in the container. This console window will appear only on your computer as you preview the site
and is not visible to your site’s visitors.
A status is displayed for every tag in the container. Each tag's status updates in the console as you
browse throughout the site and interact with each page.
Fired: The tag was fired.
Not fired: The tag was not fired. The status message specifies blocking rules.
To preview the site without the console window, uncheck the debugging option before previewing.
11. Scenario 1: Social Links
Send a Google Analytics Event when a social link is clicked that sends the
Social Media site that is being clicked to as the event label.
Category: Social Media
Action: Social Exit Link
Label: Social Network
12. Scenario 2: Downloads
Send a Google Analytics Event when a brochure is downloaded with the name of
the brochure as the event label:
Category: Brochures
Action: Download
Label: Brochure Name
13. Scenario 3: Form Fields and Submit
Send a Google Analytics Event on the thank-you page when a form field selected
with the name of the field and another event when the form in submitted:
Category: Forms
Action: field type
Label: form type
Category: Forms
Action: form submit
Label: form type
14. Scenario 4: Virtual Page Views
Send a Google Analytics Virtual PageView when the details for a destination is
clicked on.
15. How we tagged them
There are many ways to do this, this is what we came up with.