Add Google Analytics tracking code to eCommerce Store: Shopify and WooCommerce(WordPress)

Share this:

When it comes to Google Analytics, many of us may think of using it to track websites traffic only. But I will tell you it also can give you a lot of information about you store when you enable Enhanced Ecommerce Tracking in the new Universal Analytics. In short, Google Analytics allows you to track and analyse the visitors to your store, visit duration, bounce rate, the transaction information, the behavior of your customers, and more other data of your online store.

With these advanced eCommerce tracking information, you can optimize your store to boost more sales and maximize your revenues, on the other hand, it may help you minimise your marketing budget on paid ADs.

There are so many small eCommerce stores have bad product data, however, for small business, they have no idea how to save it by using a right web analytics tool. Good analytics and reports information will help you run a successful eCommerce businesses.

While Shopify Basic and WooCommerce are both offering a basic order reports overview, but it’s so poor, you can’t know where your customers are coming from, how long the visitors stay on your products pages. Luckily, Google Analytics makes this very easy, it give you new insights into the performance of your online store.

The eCommerce tracking code Installation is easy, for shopify, you only need to place the tracking code through your store admin panel, if you use WooCommerce, there are some free WordPress Plugins provide the integration between Google Analytics and your eCommerce store.

In this complete guide for beginners, we will show you how to add Google analytics to your Shopify store and WooCommerce(WordPress) store from scratch. At the end, you can find out everything you need to know about setting up eCommerce Google Analytics on your eCommerce online store. You’ll finally know how to make full use of Google Analytics to grow your businesses.

I. First of all, we will tell you how to enable your Google Analytics to activate the basic ecommerce tracking and enhanced ecommerce tracking.

II. Secondly, we would like to share with you the experience about how to connect Google Analytics to Shopify Store with the Tracking code in a few clicks.

III. Thirdly, we will learn about where to put Google Analytics Tracking code in WooCommerce(WordPress) store.

Finally, We’ll talk about the Reasons Why You Should Use Google Analytics for your eCommerce store.

Is it difficult for whom doesn’t have a lot of technical experience on Google Analytics setup?
No, so easy, you just need to follow this step-by-step guide with some clicks, let’s get start!

🔔 Pro Tip: If you still use classic Google Analytics, you should ensure you had upgraded it to Universal Analytics first, the “Universal Analytics Upgrade” button is on the top of your Admin tab. Why? because Enhanced eCommerce Tracking is only supported by Universal Analytics.

Chapter I. Create Your Google Account and Enable the eCommerce Tracking.

Step 1: First things first, If you have never used any Google products before, you have to get a Google account before using Google Analytics. If you already have an Google account, continue to the next step.

Step 2: Enable Your Google Analytics:

Open the Google Analytics In your web browser.

Sign in with your Google Account, and then Click on ‘Sign up‘ button to create your Google Analytics account.

google analytics setup sign up page

At the main sign-up page, we should choose ‘Website‘ for online store, and then type in the required information what Google Analytics calls your store property.

google analytics setup sign up step 01

🔔 Important Tip: The ‘Website URL‘ must be filled in your primary domain(www.your-store-domain.com), NOT a sub-domain.

After finishing the sign-up step, click on ‘Get Tracking ID‘ button.

google analytics setup sign up step 02
google analytics setup get tracking code

On the next screen, place your cursor into the ‘Global Site Tag‘ text box and highlight the code, use shortcut Ctrl+C(Mac:⌘Command-C) to copy the highlighted tracking code snippet.

google analytics setup global site tag

Pro Tip: You can return to the tracking code section at any time by going to Admin[⚙] > Tracking Info >tracking Code in your Google Analytics account Dashboard.

If you start a WordPress blog or run other Non e-Commerce website, just paste the tracking code before the HTML ‘</head>‘ tag on each page of your site, this is the end.

However, if you had set up an eCommerce site, we have to continue to the next step!

Step 3: Enable basic ecommerce tracking and enhanced ecommerce tracking.

Pro Tip: Personally, I Recommend Enable Both of them.

If you just want to get your store’s transaction and revenue data, you only need to enable the basic ecommerce tracking. In your Google Analytics account panel, Click Admin Gear Icon [⚙], in the View column menu, click Ecommerce Settings.

google analytics setup enable ecommerce tracking step 01

On the next screen, set ‘Enable Ecommerce‘ to ON and Save it.

If you want to get advanced information about the behavior of your customers, you should turn on enhanced ecommerce tracking. In the same column, set ‘Enable Enhanced Ecommerce Reporting‘ to ON and Save it.

google analytics setup enable ecommerce tracking step 02

Chapter II. Add Google Analytics Tracking Code To Shopify Store.

Pro Tip: Please make sure you have a Google Account and had enabled the eCommerce Tracking, if Not, continue to #I: Create Your Google Account and Enable the eCommerce Tracking.

Step 1: Head to your Shopify Admin Dashboard, go to Online store > Preferences, in the Google Analytics section, use shortcut Ctrl+V(Mac: ⌘Command-V ) to paste the tracking code you copied above into the Google Analytics account text box. Scroll to the end of the page and Click Save to save it.

shopify store add google analytics code

Step 2: Go to Online store > Preferences. in the same field, select the Use Enhanced Ecommerce checkbox to enable enhanced ecommerce tracking, then scroll to the end of the page and Click Save to save again.

shopify store google analytics setup enhanced ecommerce

Learn more about: how to Setup Google Analytics On Your Shopify Online Store.

Chapter III. Add Google Analytics Tracking Code To WooCommerce Store.

Pro Tip: Ensure you have a Google Account and had enabled the eCommerce Tracking before moving forward, if Not, continue to #I: Create Your Google Account and Enable the eCommerce Tracking.

We will use three different ways to add the Tracking Code to WooCommerce, you can choose the one you are interested in.

Method 1: Manually add the tracking code to your WooCommerce WordPress theme’s header.php file.

From your WordPress Admin Dashboard, go to [Appearance > Editor], on the right click on [Theme Header] header.php, and then Paste your Google Analytics Tracking code into the file before the HTML ‘</head>‘ tag, click on [Update File] button to save it.

woocommerce store add tracking code to header.php with wp Editor

(Optional): You can also edit theme header.php manually in you Mac or PC before uploading the zip file to your web hosting.

woocommerce store add tracking code to header.php file on local computer

Method 2: Link Google Analytics to your eCommerce Store by using the free WordPress plugin: WooCommerce Google Analytics Integration. This plugin is written by WooCommerce official developers.

In your WordPress Admin Dashboard, go to Plugins > Add New page, Search for the plugin name ‘WooCommerce Google Analytics Integration‘, then click on [Install Now] button and ‘Activate‘ it.

install WooCommerce Google Analytics Integration plugin

In WP Admin Dashboard, go to WooCommerce > Settings > Integrations, click the ‘Google Analytics‘ tab to see the settings.

In the Setting panel, add your Google Analytics Tracking ID we got above to ‘Google Analytics ID‘ field, e.g. UA-1005502266-2(you can find your Google Analytics ID here!), and then add the primary domain of your store to ‘Set Domain Name‘ field, e.g. www.your-store-domain.com.

Configure WooCommerce Google_Analytics Integration step 01

The Tracking Options listed below should be checked:
Enable Standard Tracking (if you are using a 3rd party Google analytics plugin, leave this box unchecked.)
Enable Universal Analytics
Anonymize IP addresses
Track 404 (Not found) Errors
Purchase Transactions
Add to Cart Events
Enable Enhanced eCommerce

Configure WooCommerce Google_Analytics Integration step 02

Click on ‘Save Changes‘ button to save the Options.

Method 3: Setup Google Analytics On Your WooCommerce Store with WordPress plugin: Enhanced Ecommerce Google Analytics.

Just like Method 2, install and activate the Enhanced Ecommerce Google Analytics plugin in your WordPress Plugins Page.

install Enhanced Ecommerce Google Analytics plugin

Go to the WordPress Admin Dashboard, click on ‘Tatvic EE Plugin‘ Tab on the left to the setting panel of Enhanced Ecommerce for Woocommerce Plugin.

In the ‘Google Analytics ID‘ field, fill in your Google Analytics Tracking ID, e.g. UA-1005502266-2.

Configure Enhanced Ecommerce Google Analytics step 01

And, make those options as checked:

Add Global Site Tracking Code ‘gtag.js‘ (Optional)
Add Enhanced Ecommerce Tracking Code
Enable I.P. Anonymization

Configure Enhanced Ecommerce Google Analytics step 02

Click on ‘Submit‘ button to save the settings.

Set up auto-return in your PayPal account for eCommerce Tracking.

If you use the PayPal Standard as the payment for WooCommerce store, to correctly attribute transaction and revenue data to channels in Google Analytics, you should get customers redirected back to your store after paying.

Step 1: Log into your PayPal account panel, click on Settings⚙, on My selling tools menu, choose Website preferences and click ‘Update‘.

woocommerce store paypal eCommerce tracking checkout auto return step 01

Step 2: On the Website Payment Preferences panel, turn Auto Return from OFF to ON, and then configure the Return URL like this:
https://www.your-store-domain.com/checkout/order-received/?utm_nooverride=1

woocommerce store paypal eCommerce tracking checkout auto return step 02

The Options will auto save when you make them changed.

Learn more about: How To Set Up eCommerce Tracking In Google Analytics for WooCommerce?

Conclusion

So, Why You Should Use Google Analytics?

It’s 100% free, you don’t need to pay anything. Google Analytics is probably the most essential tool for your eCommerce store, it allow you use the data of your store to build custom reports. Based on these reports, you can find out which product sell well and which advertising is providing the best return, then you will know whether your marketing is working well, so you can optimize your marketing efforts quickly.

With the right use of analytics Google Analytics, you can get a large amount of eCommerce tracking information that may only offer by some paid web analytics tools. In fact, the Google Analytics Enhanced Ecommerce Tracking gives small businesses a chance to take their online store to the next level.

If you have any problems with your Google Analytics setup, feel free to let me know in the comments below!

Share this:

Recommended:

Leave a Reply

How To Create A Free Email Signature Template (2021 UPDATE)
Build online store with Best Ecommerce website builder & Platforms(Complete steps 2019)