Tracking Magentos Onepage Checkout Steps in Google Analytics
Posted on 3/4/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.
Step 1) Modify onepage checkout template file
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.
Step 2) Set up Goal & Funnel on Google Analytics
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<br /> Match Type: Head Match<br /> Goal URL: /checkout/onepage/success/<br />
Funnel Steps: Step 1: /checkout/cart/<br /> Step 2: /checkout/onepage/<br /> Step 3: /checkout/onepage/billing/<br /> Step 4: /checkout/onepage/shipping/<br /> Step 5: /checkout/onepage/shipping_method/<br /> Step 6: /checkout/onepage/payment/<br /> Step 7: /checkout/onepage/review/<br />
And that's it!
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.