A new acquaintance pointed out that my first blog post doesnât mention Google Analytics (GA) or Google Tag Manager (GTM) despite every other page on this site saying itâs all about GA and GTMâŠoops? Iâm grateful this caught my attention because I also realized I never gave you any reason to care about HTML tags. Why should you learn it when GTM has so much stuff built in? Weâll get right to it when I return from saying âGoogle Analyticsâ to the mirror five times to make better search rankings appear.
Thing 1: Better Context on How Tagging Works
Gaining knowledge is like digging for deeply buried treasure. Sure, you can just muscle straight down. However, you will eventually reach a point youâre too deep to get the loose dirt out of your way. Youâll have no choice but to climb back to the surface and widen the hole a bit to make the bottom more accessible and let you keep searching. Depth of knowledge â while critical â requires at least some breadth. In learning, gaining surrounding context helps us better understand the structures that support our tools and how to leverage them uniquely and powerfully. This is particularly true for web analysts and implementation specialists with at least one of the following aspirations:
You want to do cool stuff in GTM.
There is so much that GTMâs default offerings canât handle. I canât blame you; thereâs much exciting stuff to explore. If you want your custom build to work, you must know how to communicate instructions to GTM accurately. The first step here is to know how GTM, the client, and the server interact to correctly identify what instructions you need to give GTM. The second step is translating those instructions into a language GTM can understand. GTM doesnât speak English, but a mix of built-in tags, triggers, and variables; JavaScript; CSS; and HTML (among other languages).
You wanna be the very best
âŠlike no one ever was.1 There are plenty of people out there who know all GTMâs tips and tricks. The feats they accomplish with such limited resources are impressive and worth a paycheck. It canât compare to someone who knows at least a minimal amount of JavaScript, HTML, and how the internet works. Some best practices, such as utilizing a data layer, actually require it. Additionally, thereâs more to analytics implementations than the implementation. Client and stakeholder education is equally important.
Most of the time, clients and stakeholders are GA/GTM laypersons. The web analytics field is niche enough that even technical stakeholders â such as web developers â often do not understand how tag management systems work. People donât like spending money on services when they donât understand why they need them or what benefit theyâll gain. Educating others accurately, concisely, and clearly requires a deeper and broader understanding of the subject matter, and GTM is no exception.
Thing 2: Debugging Tagging Implementations
A good analyst designs and implements a tagging system and makes it understandable for stakeholders. A great analyst identifies, troubleshoots, and resolves new errors before they significantly impact the data. Every tagging management system has proprietary debugging tools and access to the browserâs development tools. These tools are required to reveal what happened throughout the client-server-GTM interaction. They canât tell you what went wrong, however. Itâs up to you to find Waldo and spot what and where everything became muddled.
Debugging a GA/GTM issue mirrors searching for your misplaced car keys. You trace every seemingly insignificant step back and do a thorough search. You donât stop until you either find your keys or canât remember the prior step. In debugging, we start with performing the event that triggers the bug, evaluate the data layer, follow through the network calls, see what GTM does with the API call, and look at the final data in GA4 Debug Mode. So far, so good; the browserâs development tools and Googleâs debugging tools can handle all of this for us.2
They canât compare what we see in each step to what we expect to see and figure out what caused the change. While not technically necessary in every situation, a basic understanding of HTML and how the internet works makes this substantially easier. Every part of your dataâs journey â from the userâs interaction to the metrics in GA4 âinvolves HTML. The siteâs base code is HTML, the GTM and GA installation tags are contained within an HTML wrapper, and HTML requests and responses bring in the data: every part of the process is HTML. The ability to parse the chatter helps to identify problems and brainstorm solutions more precisely.
Thing 3: DOM Scraping and Custom HTML Tags
HTML is also a key component of DOM scraping. Without getting into the technical weeds, DOM scraping is when you rummage around a web pageâs HTML attributes so you can copy-paste and report their values. Analysts do this all the time to track the text and colors of clicked buttons, the name of a viewed product, or the date of a blog post via custom JavaScript tags within their tag management system.3
If you can help it, you shouldnât DOM scrape. Just donât. DOM scraping is like baking. Salt and sugar look very similar, but your bakes will turn out fine if everyone in the kitchen agrees on which is which. Â If someone decides salt is sugar, doesnât tell you, and then you ask them to pass the sugar, you will have some salty cake. Similarly, the tracking implementation will break if nobody enforces naming conventions within a siteâs HTML tags and attributes or if the conventions are changed without informing analysts.4
Data layers are the alternative to DOM scraping.5 Chances are, though, that youâll regularly have to DOM scrape. Implementing data layers front-loads a lot of the work, and clients will often choose the smaller immediate price tag with higher technical debt over a hefty price tag and little technical debt. When you DOM scrape, you will need a good enough understanding of HTML to parse a web document for key attributes and tags.
Thereâs also a possibility that, since DOM scraping requires a custom setup for each GTM container, you will have to write custom HTML tags to manipulate the data into your preferred format. Tag management systems only help place custom code on a site; they offer no assistance in creating said code.
Where to Go Next
If youâre newer to analytics and/or web development, pause for a deep breath. This probably seems like a lot, and maybe it doesnât quite make sense yet. And you know what? Thatâs okay. Learning these things is the first step to moving past being a novice web analyst. Itâs a process that wonât happen overnight. The point of this post isnât to scare you away from more advanced techniques; itâs to excite you by showing the end goal and providing more context as to why this work is an integral part of your journey.
Take a break to grab some water and clear your head. Now that you know why you should know HTML, look at my intro to HTML for web analysts. It introduces the structure of HTML documents, and I will later expand upon it with more technical posts about how tag management systems and analysts utilize HTML. Iâm rooting for you, and Iâm in your corner. If you have questions, please donât hesitate to contact me. If you want to learn more about a particular subject, please tell me so I can include it in future content. Thanks for taking the time to read all this, and â as always â stay awesome!
[1] I am not sorry. I will never be sorry.
[2] If you want to learn more about debugging while waiting for me to write about it, go here.
[3] Hereâs a helpful article that gets into more detail about DOM scraping.
[4] Blast X wrote an excellent blog post about the pros and cons of data layers and DOM scraping.
[5] Jim is recognized as an industry expert in data layers.
3 Responses
It’s great that you are getting ideas from this article as well as from our dialogue
made at this place.
What’s up to all, because I am in fact eager of
reading this weblog’s post to be updated
on a regular basis. It carries good information.
It’s impressive that you are getting ideas from this post as well as from our
dialogue made here.