Skip to content

Instantly share code, notes, and snippets.

@leobossmann
Last active September 3, 2020 05:25
Show Gist options
  • Save leobossmann/b07aa88788ff0b33c1cf47598c7987a3 to your computer and use it in GitHub Desktop.
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
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');
}
@malkavian-librarian
Copy link

thanks!
this thing is killing me, I was breaking my head how to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment