Blog

Home > Analytics FAQs > How to track clicks that contains specific Attributes in GTM

How to track clicks that contains specific Attributes in GTM

Sometimes you want to track clicks that have no click class or click id. Therefore you try to move up or down of DOM using custom HTML tag in GTM. You can also use Click All Elements matches CSS selector in GTM to Target those clicks using other attributes like alt text, href or any other attribute along with any attribute from the ancestors to track clicks.

Matches CSS Selector can be used with any click or form submission to easily track by moving up or down of DOM. If you wish to track any element or link clicks that contains a specific attribute like href or alt, you can use matches css selector to easily track click on them.

Simply create a trigger which fires when Click-Element matches that alt. You can also take any other unique element as well from above levels of DOM so that it does not fires on all other elements that contain the same attribute.

 track with css selector

Do you find this tip helpful? Subscribe to our newsletter to get more tips like this or follow us on twitter

Share:

Hussain

Analytics Strategy Pioneer

C-Suite Whisperer 14 Years Industry Vet

Case Studies

Discover our latest success stories and see how innovative strategies drive measurable results.

Get a Free Attribution Dashboard

Gain clear insights into what’s driving conversions and optimize your marketing spend with ease.

Are you Ready to Fast Track your Marketing Attribution Decisions and Maximize your ROI?

Businesses that leverage automated marketing
attribution see a 20-30% improvement in ad
spend efficiency.

Blog

Home > Analytics FAQs > How to track clicks that contains specific Attributes in GTM

How to track clicks that contains specific Attributes in GTM

Share: