This code allows you to track each step of Magento's One Page Checkout in Google Analytics.
The code should be installed at the bottom of the /app/design/frontend/default/YOUR_TEMPLATE_NAME/template/checkout/onepage.phtml template file.
<script type="text/javascript">
// Report each step of the checkout process to Google Analytics
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>
Once installed, you can Create a Conversion Goal.
1. Goal Name: Successful Purchase
2. Active Goal: On
3. Goal Position: Set 1, Goal 1 (I didn't have other Goals, so this was the position I used.)
4. Goal Type: URL Destination
5. Match Type: Head Match
6. Goal URL: /checkout/onepage/success/
7. Create your Goal Funnels as follows;
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/
Source : http://snippi.net/magento-report-each-step-magentos-one-page-checkout-google-analytics
This sadly doesn't seem to work on 1.4.0.1 for 2 sites i tested it on. Could you confirm?
ReplyDeletedoes the code also works for version 1.4.1.1?
ReplyDelete