|Table of Contents
UltraCart has the ability to automatically inject Google Analytics tracking code into your catalog and checkout screen branding.
The following tutorial will walk you through configuring your Google Analytics account information within your UltraCart account.
The configuration fields for Google Analytics are found in your Screen Branding configuration area. This is also the same place for other supported and third party conversion and tracking configuration.
The following shows you where to add Google tracking for your storefront.
- As you can see this section is broken up into 4 sub-sections: Adwords, Affiliate Network, Analytics, and Trusted Stores.
Simply configure your account information into the desired sections and click Save.
Configuring the GA4 tracking type requires the following credentials:
- Tracking Type = GA4
- GA4 API Secret
- GA4 Measurement ID
Obtaining your GA4 API Secret
- First, go to your Google Analytics Admin > Data Streams and open your chosen stream:
- Scroll down to the Additional Settings tab and click on Measurement Protocol API secrets; then click Create:
- You will have to create a nickname for your new API secret; we recommend naming this GA4-key. Click Create
- You will need to copy the Secret value provided into the corresponding UltraCart configuration field.
This value is confidential and should only be configured in your UltraCart account.
- All done!
Obtaining your GA4 Measurement ID
- In Admin, make sure that you have the desired account and property selected.
- In thePropertycolumn, clickData Streams, then click your web data stream. Your “G-” Measurement ID appears in the upper right portion of the panel.
Supported GA4 Events in StoreFront Visual Builder Themes
There are multiple tracking types supported by UltraCart. The table below describes the various types, the script Google uses, and whether they support asynchronous loading:
By default the system is using secure.ultracart.com in the checkout then the GA tracking is set to use that host. If you have a custom SSL then secure.yourdomain.com is passed to the tracking script as .yourdomain.com. This field will provide advanced user the ability to override this on the Google analytics tracking script.
If the integration is a checkout only and you do not have a SSL certificate applied to the storefornt checkout, then you'll configure the Cross Domain field with the domain (or domains) associated with the domain of the front end website where the customer will initate the checkout. The domain is entered without the http/https prefixes and without a subdomain.
Google Tag Manager
To configure Google Tag Manager:
Install a container in your content. Near the top of the window, find your container ID, formatted as "GTM-XXXXXX".
Click your container ID to launch the Install Tag Manager box.
Copy and paste the code snippets into your website as instructed, or download and install the appropriate mobile SDK.
Setup and installation - Tag Manager Help - Google Help
Try using this chrome plugin for testing the google tag manager:
Tracking on External Websites (with Google Tag Manager)
The way Google Analytics loads scripts, it will not replicate the data tags. To solve this problem we'll use a URL syntax instead of data attributes. For example if our merchant id is SAMPL, our StoreFront is sampl.ultracartstore.com and our website is www.mysamplesite.com, then we connect the two by placing the following tracking script into the Google Tag Manager container for the www.mysamplesite.com website:
<script async defer src="https://d9i5ve8f04qxt.cloudfront.net/UC/62/uca/0.1.0/js/collect.js?mid=SAMPL&channel=sampl.ultracartstore.com"></script>
Just change the mid and channel to match your UltraCart account.
If you have pricing tiers configured on your account for wholesale customers then you can track them on a separate Google Analytics account if you would like. There will be an additional row in the configuration for each pricing tier on your store. If you leave these blank then UltraCart will use the default UA- account when tracking the customer even if they have a pricing tier.
Frequently Asked Questions
Q: I have Google Analytics configured and it's working fine for order placed from the website, but it's not being triggered for my auto orders?
A: The Google Analytic script is fired off based on cookies in the customer browser during the checkout. Since auto orders are generated without the additional involvement from the customer's browser, the GA script is not fired.
The following message from one of our merchants describes an *unofficial* (not directly supported by UltraCart basic support, troubleshooting only available through paid support $100/hr after review by Pro Service department) workaround that they have implemented to triggered the GA script using the XML Postback:
For the latest and greatest code, please visit this github site:
Ryan has made numerous improvements since the initial development which is listed below.
StoreFront. Please see the following documentation for complete details.