Connecting Blogger to GTM and creating tag for linkClick

I already can see that some events are being sent automatically via GA4, but never enough, i decided to create a GTM  container as well. I didn't work with GTM for a while and never felt proficient with this tool so maybe now i'll learn something. 

Here's what i did:

1) Created a new container (nothing complicated)

2) I followed by inctructions given by Google, i opened code editing section the same as last time (Theme --> edid HTML [drop down list close to 'customize' button]

I pasted code excatly as it says, but i got an error, but i was not the only one with this error, I found solution here. I also got recomendation from GTM to use Tag Assistant Companion extension, which i did.
Turning on Preview mode in GTM


This is how preview mode should look after correct GTM code implementation






let's try to tag something!

Let's say i want to tag Read more button:
1) I turned on Preview mode
2) I clicked Read more on the blog, which opened in the new window
3) I checked in data layer what variable i can use to tag this button, which is elementText, i also think that elementUrl could be useful, so i decided to create 2 new variables which pass those values



Creating  new variables

1) I selected New button in Variables section


2)  I created variable (selected Data Layer Variable in settings) - to access element I'm interested in I used gtm.elementText, to access elementText which is inside gtm.





3) I checked in the preview mode if the variables have correct values during the link click - and yes it was correct 

Creating  a configuration tag for GA4

Before I created the actual tag i needed to create a configuration tag:
1) After I created a new tag I selected Google Analytics GA4 Configuration as a tag type


2) I wasn't sure where to find my Measurement ID, so i just searched for it and it showed up in Google Analytics 4 interface




Creating  a new tag

1) I selected Google Analytics: GA4 Event as Tag Type
2) I needed to select a configuration tag, so i selected the one created before
3) I selected variables i created before in Events Parametres field



4) I created a trigger:
I belive that all links have parameters as Text and URL, so i selected All links but in cases of more complex website it will probably need some limitations


5) I checked in preview mode if it worked



6) After i ensured it worked as i assumed i published changes i did in the container

Configuration new parametres in GA4 interface

After i published changes i will be able to see newly tagged event in GA4 interface, but i won't see its parametres, it has to be added in Configuration section, excatly in Custom definiotions, when I created it I had to select proper scope of new dimension and event parameter from drop-down list. After saving changes additional parametres will be visible in reports - doesn't work backwards.



And ready, now i can monitor events, which are produced only by myself.





Comments

Popular posts from this blog

Test

Connecting Blogger to Google Analytics 4