Posted on 4th, March 2012
Being able to track Checkout Abandonment is crucial when you’re focused on increasing conversions, with Magento’s one page checkout by default you can’t step up goals for Google Analytics to pick out each step, so instead we can use the trackPageview method to track fake pageviews for each step, we can then add these into our Goal steps inside GA.
First of all we need to modify the file called onepage.phtml located inside checkout/onepage.phtml within your theme’s template directory, if the file doesn’t exist here copy it across from the base/default folder:
Once you’ve got the file open paste in the following code at the end of the file, save and upload.
All that is left to do now is to set up the goal and funnel on Google Analytics so we can begin tracking our abandonment’s. To do this within the new version of Google Analytics in the top right in the main navigation bar there is a link called “Admin” on this page navigate to the Goals section under Profiles > Goals.
Then enter the following information: Google Analytics Goal Setup
Goal Type: URL Destination
Match Type: Head Match
Goal URL: /checkout/onepage/success/
Step 1: /checkout/cart/
Step 2: /checkout/onepage/
Step 3: /checkout/onepage/billing/
Step 4: /checkout/onepage/shipping/
Step 5: /checkout/onepage/shipping_method/
Step 6: /checkout/onepage/payment/
Step 7: /checkout/onepage/review/
Save those changes and voila! You’re done and now tracking checkout abandonment! On the Standard Reporting section to Google Analytics go to
Conversions > Goals > Funnel Visualization to see where your users are dropping out from the checkout process.
I'm Ash, a Magento 2 Developer @ Play Sports Network, keen cyclist and aspiring triathlete. With over eight years Magento experience!