Solved

Added to Cart" event not appearing in klaviyo metric for Dawn theme of shopify

  • 2 February 2024
  • 1 reply
  • 37 views

Badge +1

i tried all the snippet recommended by klaviyo but couldn’t do please give me some suggestions and don’t suggest me to contact support team via paid plan if possible please provide me a solution here.

 

I used this code :

 

<script type="text/javascript">
var _learnq = _learnq || [];
  var classname = document.getElementsByClassName("gTmP6we7jf gp-button-base rounded-none max-w-full relative group inline-flex items-center justify-center no-underline transition-colors duration-300 disabled:btn-disabled disabled:opacity-30 disabled:pointer-events-none hover:bg-g-highlight gp-button-atc");
var addToCart = function() {
_learnq.push(['track', 'Added to Cart', item]);
}; for (var i = 0; i < classname.length; i++) {
classname[i].addEventListener('click', addToCart, false);
}
</script>

 

 


 

My web url is :

https://trytacnation.com

icon

Best answer by kaila.lawrence 5 February 2024, 20:28

View original

1 reply

Userlevel 4
Badge +24

Hey @akibJ.! Let’s back up for a quick minute. 

 

  1. Can you walk me through in more detail the steps you took?
  2. Are you receiving any errors, or are you just not seeing any metrics being tracked yet? Keep in mind the metric only logs previously cookied browsers, which could take some time. 
  3. Did you follow the testing steps? What were the results?
  4. Have you already enabled Klaviyo’s onsite tracking for Viewed Product tracking? The Added to cart metric will not function without this. 

 

Let me know on each of the above and we’ll go from there!

 

Reply