Skip to content

Commit

Permalink
Create funnel-reports.js
Browse files Browse the repository at this point in the history
Checkout steps for the Checkout Behavior report in Google Analytics from digitaldarts.com.au/analytics
  • Loading branch information
Czarto authored Sep 10, 2020
1 parent a495917 commit 370830b
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Online Store/preferences/google analytics/funnel-reports.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Checkout steps for the Checkout Behavior report in Google Analytics from digitaldarts.com.au/analytics
var ShopifyCheckoutstep = Shopify.Checkout.step;
switch (ShopifyCheckoutstep) {
case "contact_information":
ga("require", "ec");
ga("ec:setAction", "checkout", {
"step": 1,
"option": "contact_information"
});
ga('send', 'event', 'checkout', 'contact information', { nonInteraction: true });
break;
case "shipping_method":
ga("require", "ec");
ga("ec:setAction", "checkout", {
"step": 2,
"option": "shipping_method"
});
ga('send', 'event', 'checkout', 'shipping method', { nonInteraction: true });
break;
case "payment_method":
ga("require", "ec");
ga("ec:setAction", "checkout", {
"step": 3,
"option": "payment_method"
});
ga('send', 'event', 'checkout', 'payment', { nonInteraction: true });
};

0 comments on commit 370830b

Please sign in to comment.