M
M
mirexdoors2018-04-27 19:21:30
WordPress
mirexdoors, 2018-04-27 19:21:30

How do I set up an Add to Cart goal?

Hello! Can't set up Google Analytics target.
Created the following target:
Category= Cart
Action = Add

Added to the product card woocommerce template:

var button = document.getElementById("addToCart");
   button.addEventListener( 'click', function( event ) {
  ga('send', 'event', 'Cart', 'Add')}, false );

Finds the button. There are no errors in the console. But the target is not added.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Ainur Valiev, 2018-04-28
@vaajnur

perhaps the
ev.stopImmediatePropagation() event is hung on this button

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question