From the SMX West Conference in San Jose, California, March 21-23, 2017. SESSION: Google Tag Manager: The Marketer's Essential Multi-Tool. PRESENTATION: Google Tag Manager: The Marketer's Essential Multi Tool - Given by Jonathon Weber, @jonathanweber - Lunametrics, Data Evangelist. #SMX #22C3
4. #SMX #22C3 @lunametrics
A “tag” is a bit of
HTML.
• It could be a pixel in
an <img> tag.
• It could be
Javascript in a
<script> tag.
• It’s usually for
tracking purposes.
5. #SMX #22C3 @lunametrics
A content management system manages the content of a website.
A tag management system manages the tags of a website.
6. #SMX #22C3 @lunametrics
• Access control and permissions
• Preview and test before publishing
• Manage updates and past versions
• Re-usable components
Advantages of Tag Management
9. #SMX #22C3 @lunametrics
No Javascript? No problem.
GTM has built-in listeners for clicks, form
submissions, AJAX history changes, and more.
You don’t have to see any Javascript directly
to work with them.
10. #SMX #22C3 @lunametrics
“Triggers” say when a tag
should fire
• Every page
• Some pages
• Clicks on certain elements
(based on ID, CSS Selectors)
• Form submissions
• AJAX history changes
Some GTM Lingo…
“Variables” fill in values for a
tag or trigger
• Page URL or referrer
• Cookie value
• Javascript variable
• Value of an element or
attribute in the page’s HTML
11. #SMX #22C3 @lunametrics
Lots of common
scenarios:
• Downloads
• Outbound links
• YouTube videos
• Scroll tracking
• Mailto & tel links
LunaMetrics Recipes
GTM lets you export
and import
“containers” full of
tags, triggers, and
variables.
14. #SMX #22C3 @lunametrics
A tag management tool can be
an end-run around an
uncooperative IT department
or poor tools.*
*With great power comes great responsibility. IT departments sometimes have good reasons – pesky things like
“security” and “testing”. Don’t break your website!
15. #SMX #22C3 @lunametrics
IMPORTANT:
GTM loads Javascript, which we can use to
make changes or additions to the page’s
code. Google crawls these changes
appropriately, but other crawlers might not.
This is a workaround, not a preferred method.
Special thanks to Simo Ahava, who did the initial legwork in testing that Google crawls changes by GTM correctly.
17. #SMX #22C3 @lunametrics
<link rel="canonical" href="https://blog.example.com/dresses/green-dresses-are-awesome" />
Canonical URLs
We can use GTM’s variables to construct a canonical URL from
some building blocks:
• HTTP or HTTPS
• Include www or no www in hostname
• Remove query parameters
*With great power comes great responsibility. IT departments sometimes have good reasons – pesky things like
“security” and “testing”. Don’t break your website!
20. #SMX #22C3 @lunametrics
Fear not. You don’t have to figure this out from scratch.
We’ve made a recipe for this, too (and all of the other examples in
this presentation). You’ll need to tweak for your needs (www or
no, http or https, query parameters).
Grab a handout with the link or go to
www.lunametrics.com/labs/recipes
Wait, where do I click to…
21. #SMX #22C3 @lunametrics
You’ll be able to see the <link> tag in the generated source.
In Chrome, open up the Developer Tools and go to the Elements
tab.
Is it working?
23. #SMX #22C3 @lunametrics
• Site name
• Site logo
• Social profile links
• Search box
• etc.
Structured Data Markup
24. #SMX #22C3 @lunametrics
Structured Data Markup: Tag
You can combine a bunch of blocks into a single tab. Our recipe
has examples.
You can use variables if needed (if you’re re-using these values in
multiple places or other tags).
25. #SMX #22C3 @lunametrics
• Yes, theoretically.
• But, you need to get the values (headline, author, etc.) that you
want to fill in.
• You can use GTM variables for this if the information is
accessible in the page (HTML <h1> element, for example)
• You’ll need more complex triggers and variables to achieve this,
however.
Structured Data for Articles, Events, etc.?
28. #SMX #22C3 @lunametrics
There’s a reason I said this is for the truly desperate. You don’t want
to enter those all in by hand, do you?
• Quick spreadsheet generator:
http://www.lunametrics.com/blog/2014/11/20/gtm-lookup-table-
upload/
• Support flexible matches:
http://www.seerinteractive.com/blog/gtm-match-table-
generator/
Entry 1. H as in Harry, T as in Thomas, …
31. #SMX #22C3 @lunametrics
LEARN MORE: UPCOMING @SMX EVENTS
THANK YOU!
SEE YOU AT THE NEXT #SMX
Grab a handout or go to
www.lunametrics.com/labs/recipes