I have tried to add the 'Added to cart' snippet to my code to track add to cart events but it does not seem to be working. I followed steps in the following article:
I added this code in my product.liquid :
var _learnq = _learnq || ;
_learnq.push(['track', 'Added to Cart', item]);
In my parallax theme, I have this code for the add to cart button :
<button type="submit" name="add" class="action_button add_to_cart" data-label="Add to Cart"><span class="text">Add to Cart</span></button>
I also tried to replace in the code : '.action_button.add_to_cart' by '.action_button add_to_cart' and '.add_to_cart' but it does not seem to be working.
Can anyone help please?
Have you checked that there is only one matching element on the page?
This will only add the event listener to the first button that matches those conditions.
You're right selector is definitely this based on what you've said:
But as I said - it will only attach that listener to the FIRST button in the source that matches that condition.
Look for another class around it that will identify the main product section itself as add that before the selector string above?
Can you send a URL and I might be able to provide some more exact advice.