Difference between revisions of "Google Analytics Setup"

From Whirlwind eCommerce Wiki
Jump to: navigation, search
Line 63: Line 63:
 
::* URL: "/ORDER.checkoutConfirmation:
 
::* URL: "/ORDER.checkoutConfirmation:
 
::* Name: "Confirmation/Review"
 
::* Name: "Confirmation/Review"
:* Hit "Save Goal" button. - Your goal funnel is now set!
+
* Hit "Save Goal" button. - Your goal funnel is now set!

Revision as of 22:01, 22 February 2010

Basic Setup

To setup GA (Google Analytics) to support page visitation activity reporting, place the following code in the bottom of every template on the web site, after the end body tag, before the end html tag. If you have a common footer(s) for the site, simply place in the common footer(s). NOTE: Be sure toe replace the UA number (UA-123456) with your web site's Google provided UA number.

// set pageCode
// tell system to send the fuseaction as the override pageCode 
// if the fuseaction is anything other than PAGE.view
$pageCode = ($attributes['fa'] == 'PAGE.view') ? NULL : $attributes['fa'];
 
// display googleTrack code
echo eV::googleTrack('UA-123456',$pageCode);

eCommerce Setup

To setup GA to support eCommerce transaction monitoring and reporting, place the following code in the bottom of the checkout complete template:

// get orderid from the order number (should automatically be passed in URL to order complete page)
$orderId = eV::orderGetIdFromNumber($attributes['orderNumber']);
 
// get the order data array for the passed order
$orderArr = eV::orderGetCompleteArray($orderId);
 
// display the google ecommerce transaction code
// MUST appear after eV::googleTrack has been outputted
echo eV::googleTrackTrans($orderArr);

Goal Tracking: Checkout

The following explains how to setup a Checkout Goal Tracker in Google Analytics for a Whirlwind eCommerce site.

  • Log into GA
  • Select to Edit the site profile for your web site
  • Select "Add Goal"
  • Enter the following into the available fields:
  • Goal Name: "Checkout"
  • Active Goal: "On"
  • Goal Type: "URL Destination"
  • Match Type: "Regular Expression"
  • Goal URL: "/ORDER.checkoutComplete"
  • Case Sensitive: UNCHECKED
  • Step 1: (keep adding steps until all steps are complete)
  • URL: "/"
  • Name: "Visit"
  • Step 2:
  • URL: "/ORDER.cartView"
  • Name: "Cart"
  • Step 3:
  • URL: "/ORDER.register"
  • Name: "Register"
  • Step 4:
  • URL: "/ORDER.checkoutBilling:
  • Name: "Billing Address"
  • Step 5:
  • URL: "/ORDER.checkoutShipping:
  • Name: "Shipping Address"
  • Step 6:
  • URL: "/ORDER.checkoutPayment:
  • Name: "Payment"
  • Step 7:
  • URL: "/ORDER.checkoutConfirmation:
  • Name: "Confirmation/Review"
  • Hit "Save Goal" button. - Your goal funnel is now set!