/ Published in: JavaScript
Fooman GoogleAnalyticsPlus:
http://www.magentocommerce.com/magento-connect/fooman-googleanalyticsplus.html
The key to seeing the different steps in your checkout is ensuring a page view is triggered each time one of the sections of the checkout is loaded. To do this we need to edit opcheckout.js this file should be in \skin\frontend\default\YOURTHEME\js if not then copy it there from \skin\frontend\base\default\js
Within this file search for “gotoSection: function(section)†to find the function we are interested in amending and add in the lines of code shown below.
If you are using the old analytics code then you will need to remove the slashes from the line “//pageTracker….†and comment out (add a double slash to the beginning of) the line beginning “_gaq.push…â€.
Google Analytic Gaol Setup
Goal Type: URL Destination
Match Type: Head Match
Goal URL: /checkout/onepage/success/
Step 1
URL: /checkout/onepage/
Name: Login or Register
Step 2
URL: /checkout/onepage/billing/
Name: Billing Address
Step 3
URL: /checkout/onepage/shipping/
Name: Shipping Address
Step 4
URL: /checkout/onepage/shipping_method/
Name: Shipping Method
Step 5
URL: /checkout/onepage/payment/
Name: Payment Details
Step 6
URL: /checkout/onepage/review/
Name: Confirmation
http://www.magentocommerce.com/magento-connect/fooman-googleanalyticsplus.html
The key to seeing the different steps in your checkout is ensuring a page view is triggered each time one of the sections of the checkout is loaded. To do this we need to edit opcheckout.js this file should be in \skin\frontend\default\YOURTHEME\js if not then copy it there from \skin\frontend\base\default\js
Within this file search for “gotoSection: function(section)†to find the function we are interested in amending and add in the lines of code shown below.
If you are using the old analytics code then you will need to remove the slashes from the line “//pageTracker….†and comment out (add a double slash to the beginning of) the line beginning “_gaq.push…â€.
Google Analytic Gaol Setup
Goal Type: URL Destination
Match Type: Head Match
Goal URL: /checkout/onepage/success/
Step 1
URL: /checkout/onepage/
Name: Login or Register
Step 2
URL: /checkout/onepage/billing/
Name: Billing Address
Step 3
URL: /checkout/onepage/shipping/
Name: Shipping Address
Step 4
URL: /checkout/onepage/shipping_method/
Name: Shipping Method
Step 5
URL: /checkout/onepage/payment/
Name: Payment Details
Step 6
URL: /checkout/onepage/review/
Name: Confirmation
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
gotoSection: function(section) { try { // Old Analytics code //pageTracker._trackPageview('checkout/onepage/'+section); // Newer Asynchronous Analytics code _gaq.push(['_trackPageview', 'checkout/onepage/'+section]); } catch(err) { } section = $('opc-'+section); section.addClassName('allow'); this.accordion.openSection(section); },
URL: http://blueclawecommerce.co.uk/google-analytics-goal-funnel-for-magento-one-page-checkout