1

I have a Wordpress one-pager (salient theme using visual composer) with four buttons.

Every one is linked to the same contact form, which is correct.

Now I want to add a specific ID to each button in order to track which one is most effective in Google Analytics.

I track my other events using Google Tag Manager.

yivi
  • 42,438
  • 18
  • 116
  • 138
Jack Norberg
  • 73
  • 2
  • 9
  • Can you share the link to your website? With this link, I will be able to provide detailed instruction how to build triggers for each of these buttons. If it is confidential, you can send it to me by email (you can find it in my profile) – Victor Leontyev Oct 24 '17 at 07:45
  • Sharing your research helps everyone. Tell us what you've tried and why it didn’t meet your needs. This demonstrates that you’ve taken the time to try to help yourself, it saves us from reiterating obvious answers, and most of all it helps you get a more specific and relevant answer! See also: [ask] – yivi Oct 24 '17 at 07:46
  • @VictorLeontyev https://www.restillmaldiverna.se/ Since my knowledge in WordPress is fairly limited there's not much I've tested. Thanks! – Jack Norberg Oct 24 '17 at 07:57

1 Answers1

1

1) You need to create a trigger in GTM: enter image description here

This trigger will capture clicks on all buttons which is opening contact modal popup

2) You need to create a custom variable, which will take a heading of the section, where this button is located. enter image description here Code is: function() { return jQuery({{Click Element}}).closest('.wpb_wrapper').find('.vc_custom_heading').text(); }

3) Create a tag which will send data to GTM enter image description here

4) Check your events in GA.

Keep in mind that it might take a couple of hours to appear in Behaviour-> Events tab. Or you can check it immediately in Real Time -> Events tab

Victor Leontyev
  • 8,488
  • 2
  • 16
  • 36