Google Tag Manager | unique clicks

Hey there,

I am using Google Tag Manager to track events and clicks on my website.

One page has the same element at different positions on the page. I’d like to capture specific clicks on each of those different buttons. Therefore, I need a unique identifier for each button.

Adding an ID in the customize field doesn’t help as the gtm.click event doesn’t capture the button ID.

Do you have a suggestion how to create a unique identifier here?

Hi,

Please try adding a class instead of ID.

Thanks

Hey Paul.
Tried that already. Same problem. The class is not reflected in the gtm click events. It always remains ‘x-anchor-text-primary’.

Hi,

It looks like Google is getting the data from the span tag instead of the link.

In that case, please use Classic button element instead of V2 Button.

You can also try the button shortcode

http://demo.theme.co/integrity-1/shortcodes/buttons/

Thanks

Hey Paul,

what would be a solution with the V2 buttons?

Best
Adrian

Hi There,

Can you please try adding a classic button element and let us know as @paul.r mentioned. So that we can confirm the issue and submit it to our issue tracker for further review.

Thanks!

Yes. The custom class is reflected in the gtm.click event
I gave the classic button the css class “iamspecial”. The gtm.click event recognises the click class ‘x-btn iamspecial x-btn-global’

Hey There,

Thanks for confirming. V2 button should be formatted correctly so that gtm clicks can be recorded. I’ve submitted this to our issue tracker so the developers will be made aware of it.

Thank you for your understanding.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.