Setting Up Google Analytics

Google Analytics is a free analytics tool that helps you track visitors and conversions on your store. To set up Google Analytics, you will need to create a free Google account.

Setting Up Google Analytics

1. Sign into or create your Google Analytics account.

2. Click Admin. Under Account, select Create a new account.

Create New Account

3. Complete the form, then select Get Tracking ID.

Get Tracking ID

4. Copy the tracking code provided on the following page. Be sure to copy the entire code, beginning with <script> and ending with </script>.

If you need to locate the tracking code again, you can find it under AdminPropertyTracking InfoTracking Code.

5. In the BigCommerce control panel, go to  Advanced Settings › Web Analytics.

 

In some versions of the control panel, this is located under Setup & ToolsSet up your storeWeb Analytics.

6. Check the box next to Google Analytics, then Save. Click the Google Analytics tab that appears at the top of the page.

7. Paste the tracking code into the Tracking Code field.

Tracking Code

8. Save your changes.

E-commerce Tracking

Ecommerce tracking will allow you to track your conversions with Google Analytics. It provides analytical data such as, total revenue, rate of conversions, and number of unique purchases made, just to name a few.

  • You must have a dedicated SSL as this feature does not work across multiple domains.
 

If using E-commerce tracking, the code below should be entered instead of the Google Analytics code above.

1. In your Google Analytics account, go to AdminViewEcommerce Settings.

Ecommerce settings

2. Under Enable Ecommerce, toggle the status to ON. Click Next Step.

Ecommerce tracking toggled on

3. Leave Enhanced Ecommerce Settings set to OFF. Click Submit.

4. In your BigCommerce control panel, go to Advanced Settings › Web Analytics.

5. Click the Google Analytics tab. Below the Google Analytics Tracking code, paste the following code. Replace UA-xxxxxxxx-x and yourdomain.com with your Google Tracking Number and your store's domain.

 

In some versions of the control panel, this is located under Setup & Tools › Set up your storeWeb Analytics.

<script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-xxxxxxxx-x', 'yourdomain.com');
    ga('send', 'pageview');
    ga('require', 'ecommerce', 'ecommerce.js');

    function trackEcommerce() {
    this._addTrans = addTrans;
    this._addItem = addItems;
    this._trackTrans = trackTrans;
    }
    function addTrans(orderID,store,total,tax,shipping,city,state,country) {
    ga('ecommerce:addTransaction', {
        'id': orderID,
        'affiliation': store,
        'revenue': total,
        'tax': tax,
        'shipping': shipping,
        'city': city,
        'state': state,
        'country': country
    });
    }
    function addItems(orderID,sku,product,variation,price,qty) {
    ga('ecommerce:addItem', {
        'id': orderID,
        'sku': sku,
        'name': product,
        'category': variation,
        'price': price,
        'quantity': qty
    });
    }
    function trackTrans() {
        ga('ecommerce:send');
    }
    var pageTracker = new trackEcommerce();
</script>

6. Save your changes.

Excluding Referrals From Hosted Payment Gateways

To avoid transactions made through a hosted gateway such as PayPal appearing as referrals through Google Analytics, you will need to add the payment gateway to your Referral Exclusion List.

1. In your Google Analytics account, go to AdminPropertiesTracking InfoReferral Exclusion List.

Tracking Info > Referral Exclusion List

2. Enter the domain of your payment gateway (e.g. paypal.com) under Domain.

3. Click Create.

4. For any additional domains you need to exclude, click Add Referral Exclusion.

Add referral exclusion

Additional Resources

Was this article helpful?