Track "Add to cart" action on Webflow eCommerce

This code snippet tracks all "Add to Cart" events on your eCommerce site made on Webflow.

// get all add to carts on the page and add some magic
const forms = document.querySelectorAll('[data-node-type="commerce-add-to-cart-form"]')
	form.setAttribute('onsubmit', 'callEvents()');   

function callEvents(){
// add your functions to be called here
// add common examples
Copy Code

Let your site work for you 
Tell us about your Webflow requirements.