Last active
September 3, 2020 05:25
-
-
Save leobossmann/b07aa88788ff0b33c1cf47598c7987a3 to your computer and use it in GitHub Desktop.
Checkout Steps for Enhanced Ecommerce labelling, originally by Rob Edlin, https://ecommerce.shopify.com/c/shopify-discussion/t/checkout-labelling-417229
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var step_number = 0; | |
switch (Shopify.Checkout.step) { | |
case "contact_information": | |
step_number = 1; | |
break; | |
case "shipping_method": | |
step_number = 2; | |
break; | |
case "payment_method": | |
step_number = 3; | |
break; | |
case "review": | |
step_number = 4; | |
} | |
if(step_number > 0) { | |
ga("require", "ec"); | |
ga("ec:setAction", "checkout", { | |
"step": step_number | |
}); | |
ga('send', 'event', 'Checkout', 'Option'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks!
this thing is killing me, I was breaking my head how to do this.