Enabling Google Analytics Ecommerce tracking in SamCart provides you with the necessary data to make informed business decisions and helps you understand what customer behavior leads to purchases.
You can track simple metrics such as clicks and revenue, or deeper behavioral metrics such as time on site, checkout initiation, traffic source, conversions by traffic source, and bounce rate (the possibilities are seemingly endless).
Follow the steps below to embed the Google Analytics tracking script in your checkout pages and start making more informed decisions:
Step #1: Enable Enhanced Ecommerce Tracking in Google Analytics
Your Google Analytics account won't have Ecommerce tracking turned turned on by default. To enable it, head to your Google Analytics home page and click Admin in the menu bar.
Next, select the Account, Property, and View that you want to track and click Ecommerce Settings:
Switch the Enable Ecommerce and Enable Enhanced Ecommerce Reporting to ON and you're on your way!
NOTE: Don't worry about "Related Products." That feature is deprecated as of February 2018.
Step #2: Embed Google's Global Site Tag Into Your SamCart Products
Google Analytics relies on a simple tracking script to monitor your products. This step will place said script on all of your SamCart products.
Head back to your Home tab in Google Analytics, click on Tracking Info under Property, and select Tracking Info:
On the following page, copy the block of code under Global Site Tag (gtag.js). It will look something like the following:
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-126550757-1"></script>
window.dataLayer = window.dataLayer || ;
gtag('js', new Date());
Once that's copied, head over to your SamCart Dashboard and open your Settings. Under your General Marketplace Settings (the first page that opens after clicking Settings), find Embed HTML/Scripts in Header and paste your Global Site Tag in the corresponding field:
This will inject the tracking script in the footer of all your products. After its pasted click Save Changes. We're almost there!
NOTE: If you only want to place the tracking script on certain products as opposed to all of them, open the edit page of the product(s) you're looking to track, click the "Advanced Settings" tab, and paste the script in the "Embed HTML/Scripts in Footer" field.
Step #3: Enable Google Analytics Ecommerce Tracking In Your Marketplace Settings
This last step is simple but essential. After you've injected the script into the footer of all your checkout pages, continue scrolling down the General Marketplace Settings page until you see the Google Analytics eCommerce Tracking toggle. Switch that to ON and you're ready to start working smarter, not harder!
OPTIONAL Step #4: Adjust Your Thank You Page Settings
If you're using SamCart's Thank You Page Page, your tracking script will automatically be embedded there if you've followed the steps above.
If you're using your own Thank You Page, SamCart can automatically fire your pixels before the customer is redirected. Just head to your Marketplace Settings and switch the Fire Pixels Before Redirect (Optional) slider to "ON."
This can cause a slight delay (usually less than a second). If you'd like to stop SamCart from firing your pixels before the redirect, switch the Fire Pixels Before Redirect (Optional) slider to "OFF."
Q: My conversions aren't tracking. Help!
A: Google Analytics doesn't log conversions immediately. It can take up to 48 hours for conversions to register, though they usually display much faster. If you're seeing "Active Users" on your page but no conversions, you likely just need to wait for them to register.
Also, it's worth double checking that you're successfully replaced the placeholder Tracking ID with your unique Tracking ID.
Q: I'm new to Google Analytics and am feeling overwhelmed. Where can I learn more?
A: Check out our blog on Google Analytics for Beginners: https://www.samcart.com/blog/google-analytics-for-e-commerce/
Q: Do these steps work with Google Tag Manager as well?
A: They do indeed!