How to Setup and Track Sales with Google Analytics on Bigcommerce

We recently published a guide on how to setup Google Analytics properly in Shopify. The guide was so well received we thought we should do a similar guide, this time for Bigcommerce merchants since the challenge of tracking sales by store owners cuts across ecommerce platforms.

For this guide, you’ll learn how to set up Google Analytics (GA) properly and how to turn on ecommerce tracking for Bigcommerce stores.

 

Creating a Google Analytics account

 

You’ll need a Google account to create a GA account.

1- Go to the GA homepage in your web browser and click the Sign In link in the top right corner

 

 

2- In the modal that appears, choose Analytics

 

 

3- On the redirected page, login with your Google account by entering your email address and password

4- You should see a page explaining how setting up GA works. Click the Sign up button to continue.

 

 

5- What you see on this page is the main part of the account creation process. Choose Website and not Mobile App and fill out the form. Provide your store’s url as the Website URL. The checkboxes for the Data Sharing Settings are not relevant for this guide. Click the Get Tracking ID button below after filling out the form

 

 

 

6- A popover of the Google Analytics Terms of Service Agreement will appear. Choose your country, read through the terms and accept it if you agree to it. If you can’t seem to find the I Agree button, scroll to the bottom left corner of the popover and click on the leftmost button if the cursor type changes to clickable.

 

 

7- The page will refresh and show the Tracking ID and the Universal Analytics tracking code. Copy the code snippet to your clipboard by highlighting it and pressing Command-C for Mac users (Ctrl-C for PC users)

Note: You can always find the ID and code by clicking Admin. From the Property section, click Tracking Info and then Tracking Code.

 

Setting up Google Analytics

 

1- Login to your Bigcommerce control panel

2- In the control panel, click Advanced Settings, then click Web Analytics

 

 

3- Check the box next to Google Analytics and click Save

 

 

4- Click the Google Analytics tab that appears at the top of the page.

 

 

5- Paste the tracking code into the Tracking Code field and click Save.

 

 

Excluding IP addresses

 

To ensure your store’s traffic data is accurate, you will have to exclude the visits you make to your site and the visits of others who work on your site. To do this, you’ll need to know your IP Address (Google ‘what is my ip’ to find this) and that of anyone who works on the store.

 

1- In your GA dashboard, click Admin

 

 

2- In the View section towards the right click Filters

 

 

3- Click Add Filter button to add a new filter (exclude an IP address)

 

 

4- Provide a filter name like “My IP Address”. Under Filter Type, choose Custom. Select Exclude. Choose IP Address under Filter Field. Type your IP Address in the Filter Pattern Field and click Save.

 

 

5- Repeat the steps in 4 if you have more IP Addresses to exclude.

 

Turning on enhanced ecommerce tracking

 

Turning on ecommerce tracking enables you to measure such things as conversion rate, revenue by product, performance by date among other metrics.

 

1- In GA dashboard, click Admin. From the View section towards the right, click Ecommerce Settings.

 

 

2- On the page that follows, click the Enable Ecommerce toggle ON and click Next step. At this stage, your setup will be able to do basic ecommerce tracking. Basic ecommerce tracking will give you transaction and revenue data.

Note: Turning on Enable Related Products  is optional

 

 

3- For the next step, click Enhanced Ecommerce Settings toggle ON. Doing this will give you more information on the visitor behavior.

 

 

4- Click Submit to finish the setup.

 

5- Go back to your Bigcommerce control panel. Click on Advanced Settings and then Web Analytics.

6- Click on the Google Analytics tab. The tracking code that currently exists from the previous steps is going to be replaced with the code below in order to allow for ecommerce tracking.

 

Copy and paste the following code in the tracking code field and substitute UA-xxxxxxxx-x and yourdomain.com with your Google Tracking Number and your store’s domain.

 

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

 

7- Click Save to complete the setup.

 

Conclusion

 

Now that Google Analytics has been set up for your store, you’ll be able to gather important data such as bounce rate, session lengths and other metrics and begin to understand the behavior of visitors on your site. You’ll also be able to measure the performance of your marketing campaigns and tell whether you’re getting the right ROI from the campaigns.