0

I tried to implement the click event from GA but it's not computing anything

I read documentation and tried make the following changes

1-
<a id="home-video" onClick= "dataLayer.push('send', 'event','video', 'clique', 'video2709');" ></a>

2-
<a id="home-video" onClick="ga('send', 'event', {'video', 'clique', 'video2709'});"></a>

3-
<a id="home-video" onClick="ga('send', 'event','video', 'clique', 'video2709');"</a>

4-
<a id="home-video" onClick= "dataLayer.push('send', 'event','video', 'clique', 'video2709');"</a>


var triggerButton = document.getElementById("home-video");
  triggerButton.addEventListener("click", function() {
    myModal.open();
    ga("send", "event", {
      eventCategory: "contato",
      eventAction: "clique",
      eventLabel: "botao-contato-topo"
    });
  });
3
  • Possible duplicate of How to track custom events when Google Analytics is managed by Google Tag Manager? Commented Oct 24, 2019 at 14:36
  • Have you got the base code in the header of the pages and could you share an image of it? Commented Oct 29, 2019 at 3:06
  • The site there were only the script of GTM (google tag manager) and not of GA (google analytics), I added the TAG of GA and it worked. Commented Oct 31, 2019 at 13:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.