Adding Google Analytics to ShopSite Manually


Note:

The instructions on this page are for manually adding the old (Urchin) tracking code to a store. Starting with version 8.2, ShopSite includes a utility to Automatically Configure Google Analytics for your store. Google has released a new tracking script to replace the Urchin code, which will no longer be maintained. The new script is supported by the Google Analytics integration in ShopSite starting with version 10.0.

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 manually implementing Google Analytics in your ShopSite store:

  1. Obtain and Configure a Google Analytics account
  2. Put Google Analytics Code on Store Pages
  3. Put Google Analytics Code on Shopping Cart Pages

Obtain and Configure a Google Analytics account

  1. Go to the Google Analytics Website and click on the link to Sign Up.
  2. 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.
  3. After you are signed in to Google, click on Sign Up to create a Google Analytics account.
  4. Fill out the form to create your initial account settings. This configures Google Analytics to monitor your Website: Click on Continue.
  5. Enter your Contact Information into the form fields, then click on Continue.
  6. Read through the User Agreement. If you agree to the terms, check the box below the agreement then click Create New Account.
  7. 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.
  8. When you click on Continue, you will be taken to your Google Analytics account management screen.

Put Google Analytics Code on Store Pages

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:

  1. 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:
  2. Log in to your ShopSite store, click on Preferences, then Layout Settings.
  3. Scroll down the page to the Footer section and position your cursor after any text already in the textbox.
  4. Paste the analytics code into the textbox. If you use Microsoft Windows, hold down the Ctrl key while you press the V key.
  5. Click on Save Changes at the bottom of the screen.
  6. Click on the Pages link in the top navigation menu.
  7. Click on List All Pages or use the Search Tool to find the pages you want to include the code on.
  8. 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.
  9. Click the Power Edit button.
  10. Select Display Universal Footer? from the Layout menu.
  11. Select the Global radio button and click Proceed.
  12. Select the Checkbox to display the Universal Page Footer, then click Save Changes.
  13. 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.
  14. 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.
  15. 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 Receiving Data, Google Analytics has gathered information long enough to start creating reports.

Put Google Analytics Code on Shopping Cart Pages

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.

  1. 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.

  2. In your ShopSite store, go to Commerce Setup > Order System.
  3. 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.
  4. Click on Checkout and paste the code into the Text at the Bottom of the Shipping Screen text box, then click Save Changes.
  5. 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.
  6. 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.

  1. Log in to Google Analytics and configure it for Commerce tracking:
  2. In your ShopSite store and go to Commerce Setup > Order System > Thank You.
  3. 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.

  4. 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.


ShopSite Help and Resource Center
Last updated: March 01, 2010
Give Feedback


ShopSite Shopping Cart Software