Search code examples
google-analyticsgoogle-tag-managerconversion-tracking

Click Element Tracking on Google Tag Manager & Google Analytics Conversion


I have a banner with 3 images on my homepage. I want to track how many people are clicking on one of the image (The specific one) as a conversion on Google analytics. I am planning to use Tag manager trigger to capture this action.

I have added a specific ID called "ciaBannerHome"

On the Tag Manager triggered, I have the setting below,

However, it is not capturing when people is clicking on the banner.

enter image description here

Below is what is showing on output variables on Google Tag Manager:

enter image description here


Solution

  • An Element is not a string, it's an object. Therefore, an Element doesn't typically 'contain'. Elements usually match CSS-selectors. So change the contain condition to the match CSS-selector one.

    In the value of the Click Element the debugger shows you a very precise CSS selector for it rather than the value of the element. An Element object is usually quite large to show here. Also, the preview usually doesn't stringify objects to show the values. And not every object can be stringified anyway.

    In your case, a CSS selector to match would be #ciaBannerHome where # indicates that "ciaBannerHome" is the id of the to-be-clicked element.