Tracking One Page Checkout Abandonment with Google Analytics, Properly!

Abandonment rates are key in eCommerce but the Magento integration with Google Analytics isn’t ideal, in that there is no funnel that tracks the progress (and therefore the actual point of abandonment) in the onepage checkout process. To remedy this, edit the one page checkout javascript file, located here: /skin/frontend/default/_your_theme_name/js/

As indicated below the edit starts at line 88 (v1.2), replace the whole of the gotoSection function.

88
89
90
91
92
93
94
95
96
97
gotoSection: function(section)
    {
        try {
            pageTracker._trackPageview('/checkout/' + section + '/');
        } catch(err) {}
 
        section = $('opc-'+section);
        section.addClassName('allow');
        this.accordion.openSection(section);
    },

Happy Hunting!

7 Responses to “Tracking One Page Checkout Abandonment with Google Analytics, Properly!”

Comments

  1. rune  on May 5th, 2009

    Darryl Adie, looks awesome.

    Do I only need to replace the code and add a goal / funnel in GA? If it’s the case what links do I have to enter in order to get appropriate tracking of the one page checkout?

    Thank you

  2. Darryl Adie  on May 9th, 2009

    Yes, you need to replace the code in the javascript file but there is no need to add a funnel (unless you want to) as you are in effect telling GA that each stage of the checkout process is a separate page. Hope that helps, Darryl

  3. smacka  on June 16th, 2009

    Hello,

    I have implemented the code and it does not appear to work.

    Am I right in thinking that each process of the one page checkout process is rendered as a “new page URL” thus allowing GA to track abandonment?

    Thanks.

  4. Darryl Adie  on August 2nd, 2009

    Neil, yes that is correct.

    We have had problems with ecommerce tracking in Magento in the past but it always seems to start working again a few days later. We’ve never been able to get to the bottom of why it does this but it is rather irritating when you’re relying on the metrics to calculate ROI on advertising.

    Thanks, Darryl

  5. Paul May  on September 1st, 2009

    A ha! Nicely done. I was thinking of manually adding trackpageview to the continue buttons, but this makes more sense.

  6. cubix  on November 13th, 2009

    Nice one… I think one a standard magento installation, you can define the funnels like this:

    /checkout/onepage
    /checkout/onepage/opc-billing
    /checkout/onepage/opc-shipping
    /checkout/onepage/opc-shipping_method
    /checkout/onepage/opc-payment
    /checkout/onepage/opc-review
    /checkout/onepage/opc-review-placeOrderClicked
    /checkout/onepage/success/

    Each of them will be a step.. Is this correct? I picked it up from http://www.magentocommerce.com/extension/171/fooman-google-analytics-plus

Trackbacks/Pingbacks

  1. 9 Ideen die Konversionsrate im Checkout von Magento zu optimieren « Alexander Ringsdorffs Blog  on May 24th, 2009

    [...] Tunnel-Analyse! Systeme wie Google Analytics ermöglichen die Analyse der Schritte im Checkout. Anhand der Abbruchraten der einzelnen Schritte kann man sehr gut Probleme finden und beheben. Magento hat Google Analytics inklusive e-Commerce Tracking schon von Haus aus integriert. Damit man jedoch auch die einzelnen Schritte innerhalb des One-Page-Checkout analysieren kann, muss man eine kleine Anpassung im Java Script vornehmen. [...]

Leave a Reply