Shopping Cart Forum

Go Back   eShop Forums - eCommerce Help Forum for Shopping Cart Owners. > Tech Corner > PHP/HTML/CSS/JavaScript and Servers
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
PHP/HTML/CSS/JavaScript and Servers Pick up tips and exchange info on the technical side of having a web presence.

Tie Warehouse, Click here!
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 30-09-2008, 06:55 AM
Lawrence Lawrence is offline
Forum Admin
 
Join Date: Aug 2007
Location: Kenley, Surrey, UK
Posts: 1,275
Thanks: 2
Thanked 84 Times in 84 Posts
Default Google Analytics eCommerce Tracking Module

I've just found this on 8 Awesome Google Analytics Hacks, Tips and Tricks. It's how to configure the Google Analytics ecommerce module. To turn it on, go to the account settings, and change the ecommerce Website button from "No" to "Yes", then on your receipt page, add the following code with the fields below being filled from the order confirmation page.

HTML Code:
<script type="text/javascript"><!–
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
 
document.write(unescape("%3Cscript src=’" + gaJsHost + "google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E"));
// –></script>
 
<script type="text/javascript"><!–
var pageTracker = _gat._getTracker("UA-xxxxx-x");
pageTracker._trackPageview();
pageTracker._addTrans(
"1234", // The ID for the whole transaction
"Mountain View", // The affiliate name, if there is one. If not, put as your name
"11.99", // Total transaction value
"1.29", // Tax
"5.99", // Shipping charges
"San Jose", // City
"California", // State
"USA" // Country
);
 
pageTracker._addItem(
"1234", // The ID for this single part of the order
"DD44", // Product SKU
"T-Shirt", // Product Name
"Green Medium", // Category
"11.99", // Price
"1" // Quantity
);
 
pageTracker._trackTrans();
// –></script>
To put this into practice, you would do something like this (on a PHP site).

PHP Code:
pageTracker._addItem(<?php echo "$order_id , $name , $total , $tax , $shipping , $city , $state , $country"?>);
 
etc
There're more great Google Analytics tips like this one on http://searchlightdigital.com/8-awes...ips-and-tricks

Thanks to Nass on UKBFs for originally posting the link here.
__________________
Lawrence
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
google analytics


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add Google Analytics to every page on your osCommerce store Lawrence Zen Cart & osCommerce 12 09-02-2009 02:29 AM
New module to zoom your images Magic Toolbox Magento 0 15-10-2008 08:56 PM
Google Analytics Problem.. Arkwright Zen Cart & osCommerce 10 14-01-2008 09:01 AM
Problem with Shipping Module BillH Zen Cart & osCommerce 2 24-10-2007 04:48 PM
google analytics Tinkerbell PHP/HTML/CSS/JavaScript and Servers 1 27-08-2007 04:03 PM

Google

Edible Graphics, Affordable E-Commerce, Web Shops & Custom Form Scripts
Fair Trade Quality Handmade Photo Albums & Gifts
tech news, product reviews, the latest home and business technology, the latest in digital imaging


Content Relevant URLs by vBSEO 3.0.0