Just Links click event - firing triggers not working - google-tag-manager

screenshot of red crosses
I'm new to GTM and at the beginning of setting up my first click event using a UA tag and a variable containing my tracking ID. That part fires ok. I created a simple Just Links trigger set to All Link Clicks. But when I debug with preview, I get 'Link Click' ok in the left summary, but it says tags not fired - my GA tag and inside the Firing Triggers haven't worked. There's red crosses against All Pages and the gtm filters. I've triple checked all my settings against tutorials I've followed but have no idea when the Firing Triggers have not worked?
existing tag
existing trigger
new tag
preview firing

There is an error from your trigger.
Your current trigger is pageView in all page
So you need to create an trigger For Just Link
Step1 : Change type to Just Links
Step2 : Give an appropriate name for this trigger.
Step3 : Save and change your tag's trigger to this one.
I believe this will work !
Just remember :
Tag is what you are sending.
Trigger is when you are sending.
Add :
From the comment. I guess the problem is we need to create another tag for tracking Link Click.
Since you original tag is for tracking Page View. We need to have 2 tags for your scenario.
In the event tracking. There are 3 level :
Category > Action > Label
You can come up with your own structure on this.
The screenshot is just providing a general one.
Especially for the label, You can decide whether using {{click text}} or {{click url}}

Related

GTM - Only Click DataLayer elements are available whereas I need a Trigger on a Load Element

In GTM, I'm trying to trigger on page text that's visible after a form is submitted since it does not change to another URL or refresh the page i.e. #bxAddSuccessTitle. However, the summary of events in GTM only capture the Click elements from the DataLayer. I've tried DOM, Custom JS variables, Window Load/Page View triggers and nothing populates until I click on the page.
Is there a workaround where I can trigger on something that is visible in the page source, but not necessarily in the datalayer?
enter code hereConfirmation Page
enter code hereConfirmation Page Source Code
enter code hereGTM Summary of Events
Sounds like you need a visibility trigger, probably with the "observe DOM changes" option active.
This will fire when an element comes into the viewport either by scrolling, when it is unhidden via css or, with the "observe DOM changes", when the element is created/inserted dynamically after a user interaction.
A possible caveat is that the trigger will only fire when the element is visible to the user (unhiding or inserting below the fold will not activate the trigger).

Google Tag Manager trigger not firing with specific conditions

I have Google Tag Manager setup for a client of ours. We are trying to track a simple mailto link on the website. The link tag wraps an image icon like so:
<a class="email-share-link" title="share-email" href="mailto:someone#example.com"><img src="icon.gif" /></a>
We are able to send the title attribute to Google via the Tag configuration, but ONLY when the Trigger is setup to fire on ALL clicks. We only want this data sent to Google when this particular link is clicked. We attempted at configuring the trigger to fire when the title tag contains "share-email" but the trigger is not firing. When we change trigger to fire on "All Clicks" we see the title attribute in Google Analytics. Here is the setup we have attempted:
Tag Configuration:
Track Type: Event
Label: {{Link Title Attribute}}
Non-Interaction Hit: False
Trigger Configuration:
Trigger Type: Click - All Elements
This Trigger Fires On: Some Clicks
Fire this Trigger When Event Occurs: Link Title Attribute contains share-email
Any help would be greatly appreciated.
One solution would be to use the CSS class email-share-link in your trigger (assuming that that class is specific only to the mailto link).
Alternate tagging solution: I tried this configuration and it seems to be working, as in when I click the image, the gtm.linkClick event fires the tag with the label containing "share-email"
Tag
Trigger
Link Title Attribute variable

How do I configure GTM to track only successful sign-ups on this site?

Given that I want to track successful sign-ups
When I set up in Google Tag Manager:
Trigger type: Click - All Elements
Trigger fires on: click classes contain "ht-app__form-submit"
Then my trigger fires any time someone hits the "Sign button" on this page
https://www.myhometouch.com/app/register
OK.
However, I only want to track the clicks where the sign-up was successful, so I want to "check validation" but this creates two questions for me:
1. With trigger type "All Elements" you cannot enter a validation, but if I select the other option "Click - Just Links", then my Google Tag Manager debugger shows that my Tags are not firing anymore. So which event type do I need to set up in GTM?
2. After I find the right event, what would be the correct "check validation" to enter to make sure only successful sign-ups are counted? Would it be Click URL with some value? Any insight in this would be much appreciated.
many thanks
screenshot
I would push an event to dataLayer after the successfully validation (supposing you have access to the project code files where the validation is made)
dataLayer = window.dataLayer || [];
dataLayer.push({
'event' : 'signupEvent',
});
And then I'd use that event to create a custom trigger to fire the desired Tag
HTML forms and links (references) are two diffent type of things. Your form is not a link, so this is not the right path.
You also don't need the explicit click tracking but the form submission tracking. Select the trigger "form submit". Then check the box "check validation". In the next drop down you can select the variable "Click Classes". This one should contain the value of your form class.
You can declare a variable in Google Tag Manager that checks if the Login Form input texts are filled (not empty) and then, pass this variable to the trigger and set it to fire only if fileds are not empty.
Please find an example in these screenshots:
GTM variable
GTM trigger
Hope this was helpful !

Why can't I see Event Listener as an option under Choose Product part in Google Tag Manager

I'm trying to create an Auto Event Tracking tag in GTM. However, I can't find Event Listener option under product types. You can see the screenshots of two tags with and without Event Listener.
What am I missing?
Thanks for helping out.
Are you wanting to fire a tag based on an event that occurs? From the looks of your tag name, Link Click Listener, you'll want to create a trigger that matches your criteria and then apply the trigger to the tag(s) you are creating. You needed to create event listeners in older versions of GTM, but the newer versions will automatically listen to link clicks. More info on auto-event triggers can be found here.
click listener trigger screenshot

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