Google Analytics
- Topics:
- Marketing Tools
- Integration
CREATED FOR:
- Beginner
- Intermediate
- Admin
- Leader
- User
Google Analytics gives you the ability to define additional custom dimensions and metrics for tracking, with support for offline and mobile app interactions, and access to ongoing updates. Google Analytics 4 is Google’s next-generation measurement solution, and is replacing Universal Analytics. On July 1, 2023, standard Universal Analytics properties will stop processing new hits.
Google Analytics 4
Step 1: Set up Google Analytics 4
If you do not already have a Google Analytics 4 setup for your site, follow one of these methods:
Step 2: Complete the Commerce configuration
-
Log in to the Admin for your Commerce store.
-
On the Admin sidebar, go to Stores > Settings > Configuration.
-
In the left panel, expand Sales and choose Google API.
-
Expand
-
Expand
-
Set Enable to
Yes
. -
Leave the Account type as
Google Analytics4
. -
Enter your Measurement ID. To learn more, see Google Analytics Help.
-
If you want to conduct A/B testing and other performance tests on your content, set Content Experiments to
Yes
.
-
-
When complete, click Save Config.
Google Universal Analytics
Step 1: Set up Google Universal Analytics
Visit the Google website, and sign up for a Google Universal Analytics account.
Step 2: Complete the Commerce configuration
-
Log in to the Admin for your Commerce store.
-
On the Admin sidebar, go to Stores > Settings > Configuration.
-
In the left panel, expand Sales and choose Google API.
-
Expand
-
Set Enable to
Yes
. -
Enter your Google Analytics Account Number.
-
If you want to conduct A/B testing and other performance tests on your content, set Content Experiments to
Yes
.
-
-
When complete, click Save Config.
Enhanced Ecommerce
Enhanced Ecommerce is a plugin for Google Universal Analytics that gives you insight into the shopping and purchasing behavior of your customers. You can use Enhanced Ecommerce to produce reports about key customer activities, such as when customers add items the cart, begin the checkout process, or complete a purchase. You can also identify and analyze patterns of shoppers who abandon their carts without making a purchase.
The following instructions show how to configure Google Tag Manager with Universal Analytics to produce Enhanced Ecommerce data and reports.
Step 1. Sign up for Google accounts
-
Sign up for a Google Tag Manager account, and complete the Commerce configuration.
-
Sign up for a new Google Universal Analytics account.
Step 2. Configure Enhanced Ecommerce
-
Sign in to your Google Universal Analytics account.
-
Create a property for Enhanced Ecommerce analytics with the following settings:
- Status: ON
- Related Products: ON
- Enable Enhanced Ecommerce Reporting: ON
- Checkout Labeling: (not required)
-
When complete, click Submit.
Step 3. Create tags and triggers
-
Sign in to your Google Tag Manager account and create the following triggers:
NameEvent TypeFilteraddToCart
Custom Eventcheckout
Custom Eventcheckout only
Page ViewPage URL matches RegEx /checkout/.*checkoutOption
Custom Eventgtm.dom
Custom EventproductClick
Custom EventpromotionClick
Custom EventremoveFromCart
Custom EventNOTE
The Checkout event is triggered for the built-in Commerce basic payment methods only (such asCheck / Money Order
andCash On Delivery Payment
). This event is not executed forPayPal checkout
and other external payment methods, which use redirection to the checkout from external resources. -
Create the following Universal Analytics tags with the same basic configuration.
-
Universal Analytics Tags
NameTypeFiring triggersAdd to cart tracking
Universal AnalyticsaddToCartCheckout option tracking
Universal AnalyticscheckoutOptionCheckout tracking
Universal AnalyticscheckoutPageview tracking
Universal Analyticsgtm.domProduct click tracking
Universal AnalyticsproductClickPromo click tracking
Universal AnalyticspromotionClickRemove from cart tracking
Universal AnalyticsremoveFromCart -
Basic Tag Configuration
SettingValueProductGoogle AnalyticsTag TypeUniversal AnalyticsTracking IDUA-XXX (The tracking ID from your Universal Analytics account.)Enable Enhanced Ecommerce FeaturesTrueUse data layerTrueUse Debug versionTrue
-
-
Complete the individual tracking configurations.
-
Enter the following Add to Cart tracking settings:
SettingValueTrack TypeEventCategoryEcommerceActionAdd to CartTriggeraddToCart -
Enter the following Checkout option tracking settings:
SettingValueTrack TypeEventCategoryEcommerceActionCheckout OptionTriggercheckoutOption -
Enter the following PageView tracking settings:
SettingValueTrack TypePageViewTriggergtm.dom -
Complete the following Product Click tracking configuration:
SettingValueTrack TypeEventCategoryEcommerceActionProduct ClickTriggerproductClick -
Complete the following Promotion Click tracking configuration:
SettingValueTrack TypeEventCategoryEcommerceActionPromotion ClickTriggerpromotionClick -
Complete the following Remove from Cart tracking configuration:
SettingValueTrack TypeEventCategoryEcommerceActionRemove from CartTriggerremoveFromCart
-
-
When complete, click Preview and verify that the tags work correctly.
-
After verifying the settings, click Publish.