Add Magneto cart abandonment funnel to Google Analytics
Add the following code to checkout/onepage.phtml
at the bottom.
By default this file is located here:
app/design/frontend/base/default/template/checkout/onepage.phtml
In a custom theme is would be somthing like:
app/design/frontend/default/shopper/template/checkout/onepage.phtml
//<![CDATA[
Checkout.prototype.gotoSection = function(section, reloadProgressBlock) {
try {
_gaq.push(['_trackPageview', '/checkout/onepage/' + section + '/']);
} catch (err) {}
var sectionElement = $('opc-'+section);
sectionElement.addClassName('allow');
var sectionElement2 = $('top-opc-'+section);
sectionElement2.addClassName('allow');
this.accordion.openSection('opc-'+section);
this.reloadProgressBlock(section);
};
//]]>
Admin > VIEW > Goals
NEW GOAL
.Custom
Checkout Success
Destination
/checkout/onepage/success/index.php
Name | URL |
---|---|
Cart | /checkout/cart/index.php |
Login | /checkout/onepage/index/index.php |
Billing | /checkout/onepage/billing/index.php |
Shipping | /checkout/onepage/shipping/index.php |
Shipping Method | /checkout/onepage/shipping_method/index.php |
Payment | /checkout/onepage/payment/index.php |
Review | /checkout/onepage/review/index.php |
index.php
at the end of my destination URL and funnel URLs. You may not have to. Be sure to click Verify
when setting up your funnel to test this.