Google Tag Manager link click image

Viewed 356

I'm using Google Tag Manager to send an event to Google Analytics when you click an <a> or a<button> tag, which works fine.

However I also have an <a> tag wrapping an <img> and the event is not firing because the element getting clicked is not the <a> tag, it's the <img> tag.

I've tried to move my .sau-btn to the <img> tag but this doe not work either. I've also tried to move my a tag to act as a hotspot on top of it.

<a href="#" @click="openSaleOfferModal(true, 'enterprise')" style="display:inline-block; border:1px solid red; background-color:green z-index:99; position:relative;"><v-img :src="require('@/assets/img/sales-banner-enterprise.jpg')" class="gtm-btn" data-gtm-category="Sales Offer" data-gtm-action="Test Link" data-gtm-label="Image Real Link One" alt="alt tag"></v-img></a>

How get I get my event to fire when you click anything inside of the class that it is holding?

Google Tag Manager

1 Answers
Related