Using Google Analytics with ShopSite
Google's web analytics service enables advertisers and publishers to make their marketing campaigns more efficient and their websites more effective. ShopSite Merchants can use Google Analytics to track customer activity throughout the store, including purchases. Analytics integrates with other Google tools, including Google AdWords.
There are three steps to implementing Google Analytics with your ShopSite store:
- Obtain and Configure a Google Analytics account
- Put Google Analytics Code on Store Pages
- Put Google Analytics Code on Shopping Cart Pages
Obtain and Configure a Google Analytics account
- Go to the Google Analytics Website and click on the link to Sign Up.
- If you already have a Google account (all Google services use a single account for access), sign in using that account. If you do not yet have a Google account, click on the link to create a new account.
- After you are signed in to Google, click on Sign Up to create a Google Analytics account.
- Fill out the form to create your initial account settings. This configures Google Analytics to monitor your Website:
- Website URL - Select HTTP or HTTPS (secure), then enter the domain name of your ShopSite store.
- Account Name - This is the Analytics account name, which is different from your Google account name. You will later have the option of giving other Google accounts access to your Analytics account. Your domain name will be automatically assigned as your account name, but you may change the name to something else if you prefer.
- Time Zone Country or Territory - This is the timezone that will be used for the reports. You may want to use the timezone where your office is for this, although if your server is in a different timezone, you may want to use that timezone instead.
- Time Zone - This is the timezone that will be used for the reports. You may want to use the timezone where your office is for this, although if your server is in a different timezone, you may want to use that timezone instead.
Click on Continue.
- Enter your Contact Information into the form fields, then click on Continue.
- Read through the User Agreement. If you agree to the terms, check the box below the agreement then click Create New Account.
- The next screen contains the code that you must add to every Web page you want to track. You may want to copy and paste the code into a text file on your local computer until you are ready to edit your store pages. The code can be accessed from your Analytics account later, also.
- When you click on Continue, you will be taken to your Google Analytics account management screen.
You must include the Google Analytics code in any Web pages you want to have tracked. If you are using ShopSite generated pages, the easiest way to get the code on all your pages is to include the code in your Universal Store Footer:
- Copy the analytics code. If you saved the code to a file on your computer, open that file in a text editor. You can also get the code again from Google Analytics:
- Log in to your ShopSite store, click on Preferences, then Page Header & Footer.
- Scroll down the page to the Footer section and position your cursor after any text already in the textbox.
- Paste the analytics code into the textbox. If you use Microsoft Windows, hold down the Ctrl key while you press the V key.
- Click on Save Changes at the bottom of the screen.
- Click on the Pages link in the top navigation menu.
- Click on List All Pages or use the Search Tool to find the pages you want to include the code on.
- Select all the pages you want the code to appear on from the list. If you use Microsoft Windows, hold down the Ctrl key and click on the name of each page you want to use, or hold down Ctrl and press the A key to select everything in the list.
- Click the Power Edit button.
- Select Display Universal Footer? from the Layout menu.
- Select the Global radio button and click Proceed.
- Select the Checkbox to display the Universal Page Footer, then click Save Changes.
- To include the footer on Product More Information pages, go to Store Preferences > More Info Pages and select the Show Page Footer checkbox, then click Save Changes.
- You can also include the footer on Search pages. Go to Store Preferences > Search Settings > Search Layout, select the Page Footer checkbox and click Save Changes.
- Click on Publish to publish your store with the tracking code in the footer.
If you want to include the code in pages not generated by ShopSite, Google Analytics recommends pasting the code just before the </body> tag on your pages.
Once the analytics code is on your pages, you can check to make sure tracking is working by going to the Google Analytics Management Screen and looking at the Status of your store profile. If the status is unknown, there will be a link to Check Status. When you click on that link, Google Analytics will test your site to see if the code is present and working. If your status is Waiting for Data, your code is working properly and Google Analytics is gathering information. When your status becomes Recieving Data, Google Analytics has gathered information long enough to start creating reports.
Tracking customer activity through the checkout process is a valuable tool for knowing how effective your Website is. Google Analytics makes it possible not just to see how many visitors convert into sales, but you can also track what is being sold.
The first part of tracking Shopping Cart activity is to include the analytics code on your shopping cart pages.
Note: |
These instructions work for merchants whose shopping cart is on the same domain as their store. There are special instructions in the Google Analytics help for configuring tracking across multiple domains, which you can implement with Custom Templates.
|
- If necessary, repeat step 1 in Put Google Analytics Code on Store Pages
Note: |
In order to work on secure pages without generating a security warning, the URL in the Google Analytics code must also be a secure URL. If you have ShopSite configured to use SSL, replace the non-secure urchin.js URL:
http://www.google-analytics.com/urchin.js
with the secure URL:
https://ssl.google-analytics.com/urchin.js
on your Checkout, Confirmation, and Thank You screens.
|
- In your ShopSite store, go to Commerce Setup > Order System.
- Click on Shopping Cart and paste the code into the Text at the Bottom of the Shopping Cart Screen text box, then click Save Changes.
- Click on Checkout and paste the code into the Text at the Bottom of the Shipping Screen text box, then click Save Changes.
- If you are using a confirmation screen, click on Confirmation and paste the code into the Text at the Bottom of the Confirmation Screen text box, then click Save Changes.
- Click on Thank You and paste the code into the Text at the Bottom of the Thank You Screen text box, then click Save Changes.
Once tracking is working on your shopping cart screens, you can include JavaScript on your Thank You screen to pass the contents of the cart to Google Analytics.
- Log in to Google Analytics and configure it for Commerce tracking:
- Go to the Google Analytics Website and sign in.
- From the account management screen, find the Website Profiles section, and Edit the profile for your store.
- Find the section named Website Profile Information and click the Edit link to edit your profile.
- Select Yes for the E-Commerce Website option, then click Save Changes
- In your ShopSite store and go to Commerce Setup > Order System > Thank You.
- Insert the following JavaScript in the same field as you entered the tracking code, after the tracking code:
<form style="display:none;" name="utmform">
<script language="javascript" type="text/javascript">
document.write("<textarea id=\"utmtrans\">");
document.write("UTM:T|" + ss_ordernum + "|" + ss_associate + "|");
document.write(ss_ordertotal + "|" + ss_taxtotal + "|" + ss_shiptotal + "|");
document.write(ss_city + "|" + ss_state + "|" + ss_country + "\n");
for (var p = 0 ; p < number_products ; p++) {
document.write("UTM:I|" + ss_ordernum + "|" + ss_sku[p] + "|" + ss_name[p] + "|Products|");
document.write(ss_price[p] + "|" + ss_quantity[p] + "\n");
}
for (var c = 0 ; c < number_coupons ; c++) {
document.write("UTM:I|" + ss_ordernum + "|" + ss_coupon_name[c] + "|" + ss_coupon_name[c]);
document.write("|Coupons|" + ss_coupon_discount[c] + "|1" + "\n");
}
document.write("</textarea>\n");
</script>
</form>
<script language="javascript" type="text/javascript">__utmSetTrans();</script>
Note: |
This JavaScript is provided as an example, and is not guaranteed to work. If you have troubles implementing this code, please consult your own JavaScript programmer for help.
|
- Click on Save Changes to save your changes.
The next time someone purchases something from your store, the cart contents should be sent to Google Analytics. It may take up to 24 hours before purchase history is available in your Google Analytics reports.