Magento Google Analytics Funnel for Tracking Each Step of One Page Checkout

Magento Google Analytics – I have spent the entire afternoon working on a client’s Magento website. As an update to my previous post “Magento One Page Checkout vs. Multipage Checkout“, I needed to set up a Google Analytics funnel to accurately track each step of the One Page Checkout process. Because it obviously only uses one page and AJAX, the default Google Analytics configuration is not able to track each of the six steps of the checkout process to determine where the visitors are abandoning their transactions. Clearly, it is very valuable to have that information available. Luckily for us, we are able to do just that. Here are the steps:

1. Open up the template file /app/design/frontend/default/YOURTEMPLATENAME/template/checkout/onepage.phtml in a text editor or WYSIWYG web editor such as Dreamweaver.

2. Paste the following code to the very bottom of the onepage.phtml file (You may have to replace the quotes in plaintext for it to work, fyi):

<script type=”text/javascript”>
Checkout.prototype.gotoSection = function(section) {
try {
pageTracker._trackPageview(‘<?php echo $this->getUrl(‘checkout/onepage’) ?>’ + section + ‘/’);
} catch(err) { }

section = $(‘opc-’+section);
section.addClassName(‘allow’);
this.accordion.openSection(section);
};
</script>

3. Save and upload the template file and you are done with the hard part and you will now be able to track the views of each of the six steps!

4. Now if you want to set up the Google Analytics conversion tracking and funnel to determine where the users are dropping off, you can do so by creating a new Goal in Google Analytics and by using the following settings:

Goal Type: URL Destination
Match Type: Head Match
Goal URL: /checkout/onepage/success/

Funnel Steps:

Step 1: /checkout/onepage/
Step 2: /checkout/onepage/billing/
Step 3: /checkout/onepage/shipping/
Step 4: /checkout/onepage/shipping_method/
Step 5: /checkout/onepage/payment/
Step 6: /checkout/onepage/review/

And that’s it!

Magento One Page Checkout vs. Multipage Checkout

Anybody have any info on whether the Magento One Page Checkout is better than the Multipage Checkout? I think as a user and as someone who deals with conversion rate optimization on a daily basis, I would normally prefer the One Page Checkout 99% of the time. However, I have been looking through the GetClicky stats for one of my client’s websites and there seems to be a fairly high rate of shopping cart abandonment on the Onepage checkout. It could certainly mean there is a technical error of some kind that I have yet to find but I keep trying to recreate the error and have had no such luck. I may set up an A/B Split Test to compare the One Page Checkout vs. the Multi Page Checkout. Let me know if there are any Magento developers out there that have noticed some weird issues going on with their shopping carts.