Google Analytics 4 view item list probleme with item_name - google-tag-manager

i try to send view_item_list event to GA4, but i have a probleme.
when I try to send items with item_name property filled, GA4 does not capture the event.
When i try whitout this property, GA4 capture the event !!
my item_name like item exemple
When i send item balise like item exemple whitout name
GA4 capture the event
GA4 event exemple

Related

Script to get eventId from selected google calendar event

I am trying to make a chrome extension that will pull out properties from an event selected on the google calendar web interface and format them into text that can be pasted elsewhere. The part I am struggling with is how to get the eventId from a selected event. So if I go to a calendar and click on an event, this script should be able to get the eventId for the event in focus (example below) and then call the get() function for that event.
Example of selected/in focus event
I have only tried searching documentation and asking AI. Not finding anything.

Adding new data layer variable for click / element visibility event

On my blog, I have a related content section and I want to track which images get the most clicks.
I'm using Google Tag Manager which already triggers an event in Google Analytics when a post in the related content is visible and then clicked, but I can't manage to pass through the image ID to Google Analytics as a Custom Dimension for reporting.
How do I add this value as it's own data layer variable?
I've tried adding a custom event but this creates a new event, but I want to add the ID to the click event or the element visibility event.

Google Tag Manager custom event (product page views) not firing tags

I tried to set up a tag that should be firing when a customer goes on the product page.
I found out in the dataLayer that there is this object: pageType: 'product'
After that I used this object in my trigger as so:
In the tag itself, I made sure that enhanced ecommerce was enabled, and also checked the checkbox that dataLayer is being used, however it is still not firing.
The first thing you need is to create a custom variable to capture the information stored in the dataLayer.
In the main menu, click variables:
Click on the button "New" in the User Defined Variables section.
Name the variable DLV - pageType, select Variable Type Data Layer Variable name it pageType and hit Save when you are done:
Next, click on Triggers in the main menu to add a new trigger. Name the trigger, select Page View as trigger type, Only Some Page Views and make sure it only fires when DLV - productType equals product:
Now the only thing that is left is to configure the tag to the trigger.

Google Tag Manager Event in Analytics as Goal

When I us Google Tag Manager for tracking a Link-Click, it shows up as an Event in Google Analytics. So far so good.
Let's say in GTM: Category is {{Event}} / Action is {{Click Event}} and Label is {{Page Path}}
Now I will have this Event as Analytics Goal (Conversion) - not AdWords. So Am I right, I have to set up in Analytics the Goal again but can't us the variables from GTM?
So the Category must be like "Test" Action "Click" Label "Link Click" or can I say, track my GTM Event in Analytics as Goal like linking them thogheter?
In GTM you can't set up an Analytics Goal right? You have to do the Event and then go to Analytics and make it as a Goal, true?
if you are using GTM to tracking event. it is not necessary to give {{Event}} or any predefined Macro(variables) as Event Category , Event Action or Event Label.
It is entirely upto you . You can give any string/ name the create goal in google analytics..
Link if you are click on any download link
Event Category will be 'Download Link',
Event Action you can choose as {{Click text}} or {{Click URL}}
and Event Label as {{{Page Path}}
after that at the time of goal creation you can use 'Download Link' as Goal Category and leave action and label. it will help you to tracks all download link as well as link url and on which page this event occcurs.. so on

Capturing Multiple dataLayer Attributes with Google Tag Manager

I have been able to capture and push URL's with the Google Tag Manager default, but I have been having trouble trying to push custom data layer attributes.
For example:
Before the GTM script loads I push the current page url into the dataLayer.
<script>
var currentPage = (document.URL);
dataLayer = [{
'pageURL': currentPage
}];
</script>
And then on various elements I'm pushing content to the dataLayer when they are clicked:
<a id="tracking-image" href="#" onclick="dataLayer.push({'#elementID': 'tracking-image'});"></a>
I've been having trouble capturing these in GTM / Google Analytics. Ultimately I would want in captured in Google Analytics like so:
Label: currentPage
Action: tracking-image
But currently it's just tracking the gtm.js event firing multiple times.
You do not need to push the element id to the datalayer (GTM can read the id by itself). What you are missing is an event to trigger your tag.
"Events" in GTM are not related to event tracking in Analytics and only vaguely related to native Javascript events. "event" is a reserved macro name, and it's purpose is to trigger tags; there are some pre-defined events on page load start (gtm.js) , page load finish (gtm.dom) etc.
If you want to trigger a tag that does not fire on page load chances are that you need a custom event.
One way would be to change your code like this:
<a id="tracking-image" href="#" onclick="dataLayer.push({'event': 'imagetracker'});"></a>
Then you could set up a rule with the condition "{{event}} equals imagetracker" which you fire your tag.
Probably a better way would be to use GTMs event listener tags. There is a link click event listener tag and a generic click listener tags. Since your link target is not a valid url I would choose the generic click listener. So you'd set up a new tag of the type click listener and have it fire on all pages. Now if an element is clicked the event macro will be assigned the value of GTM click.
Event listeners will also automaticall fill auto-event variables that hold various properties of the clicked element. This would allow you to access the clicked elements id though a macro called, somewhat unsurprisingly, "element id".
So you would create a rule where "{{event}} equals gtmClick" AND "{{element id}} equals imagetracker". That would fire a tag if the link is clicked.
Caveat is that GTMs event listener tags fail when there is already a click event on the element that returns "false" to suppress standard behaviour. Infos and workaround are and workaround on Simo Ahavas Blog (which is pretty much the go-to place for all things GTM-related).

Resources