Through Google Tag Manager, I have successfully made a connection to track page views for my company site. I have debugged this in GTM and also see the "real time" results loading in Google Analytics. But I want to take things further than just page views being tracked. I want to track a GTM variable as a GA event.
For the same Google Tag Manager Workspace, I went to the "Variables" page and created a new variable called "Certain HTML Element Class Name". The point of the variable is to collect the class name found on my
<html> element. For example, collect cat from:
<html class="cat"> .... </html>
I am successful in seeing this value displayed in GTM's debug window.
But!!! How in the world do I send that variable data to Google Analytics as an event? I want to see from Google Analytics that every time a page is loaded, GA fires my GTM variable as an event.
Is this possible?
Just to show what I have attempted to do - here are my settings in GTM. Am I on the right track??? Am I missing something? Appreciate any feedback!