Track Store Events with Google Analytics

Enabling Google Analytics for your StoreFront provides you with detailed statistics about StoreFront events while the customer is shopping and during the checkout process. To take advantage of Google Analytics for your StoreFront, you first have to enable Google Analytics in the site editor and then enable eCommerce tracking in your Google Analytics account.

If you do not already have a Google Analytics account, create an account for Universal Google Analytics or the newer Google Analytics 4. To learn about the differences between the two, see Universal Analytics versus Google Analytics 4 Data.

Enable Google Analytics for Your Site

To enable Google Analytics in the editor:

  1. In the side panel, click Settings, and then click the Google Analytics tab.

  2. Enter your Google Analytics code. If you are using Universal Analytics, the code will start with “UA”. If you are using Google Analytics 4, the code will start with “G”.

  3. Type Enter to confirm.

Once Google Analytics is enabled for your site it is automatically connected to your StoreFront.

Note

If you receive an invalid account error message, this means your Google Analytics account is invalid, misspelled, or you are using the wrong code. We recommend copying and pasting the code directly from your Google Analytics account to avoid errors.

Enable eCommerce Tracking

After enabling Google Analytics for your site, it is automatically connected to your StoreFront. You still need to take additional steps to enable eCommerce specific tracking. Depending on which version of Google Analytics you use, proceed to the applicable section.

Google Analytics 4

To enable eCommerce tracking in Google Analytics 4:

  1. Sign in to your Google Analytics account.

  2. From the side menu, click Admin.

  3. Select your account and your GA4 property.

  4. Click Admin, then click Data Streams.

  5. Click the stream of your Store and copy the Measurement ID.

  6. Navigate to your site. In the side panel, click eCommerce, then Manage StoreFront.

  7. Click Settings, then General.

  8. Click the Tracking & Analytics tab.

  9. Paste your Measurement ID in the Google Analytics ID field.

  10. Click Save.

Google Analytics 4 is now enabled for your StoreFront and the following events can be tracked:

  • page_view. Views of StoreFront pages.

  • view_item_list (with parameters). Views of product categories, favorites, or search results.

  • view_item (with parameters). Views of any product details page.

  • search (with search_term parameter). Searches by keyword.

  • login (with method parameter). Logins into customer accounts.

  • add_to_wishlist (with parameters). When a shopper adds a product to their favorites.

  • add_to_cart (with parameters). When a shopper adds a product to their cart.

  • remove_from_cart (with parameters). When a shopper removes a product from their cart.

  • share (with method and content_id parameters). When a shopper shares a product using share buttons.

  • begin_checkout (with parameters). When a shopper begins the checkout process.

  • add_shipping_info. When a shopper chooses a shipping method and proceeds with checkout.

  • add_payment_info (with parameters). When a shopper chooses a payment method and clicks Place Order.

  • purchase (with parameters). When a shopper places an order.

Note

It takes 24 hours for the first results in Google Analytics reports to populate.

Universal Google Analytics

Note

By default, the Measurement ID (the “G”-ID) is created for the new Google Analytics accounts. If you already created an account that only has a Measurement ID and want to use a Tracking ID (the "UA-" ID), you need to create a Universal Analytics property.

To enable eCommerce tracking in Universal Google Analytics:

  1. Sign in to your Google Analytics account.

  2. From the side menu, click Admin.

  3. Select your account and your UA property.

  4. Click Admin, then click Property Settings.

  5. Copy the Tracking ID.

  6. Navigate to your site. In the side panel, click eCommerce, then Manage StoreFront.

  7. Click Settings, then General.

  8. Click the Tracking & Analytics tab.

  9. Paste your Tracking ID in the Google Analytics ID field.

  10. Click Save.

  11. Navigate back to your Google Analytics account and click Admin.

  12. Click Ecommerce Settings under the View column.

  13. Switch the toggle to On for Enable Ecommerce and Enable Enhanced Ecommerce Reporting.

  14. Click Save.

Universal Google Analytics is now enabled for your StoreFront and the following events can be tracked:

  • Views of any store page.

  • Views of product pages, including the ID of the product viewed in the StoreFront, its name, category, and price.

  • Adding product to shopping cart, including the IDs of products added to the cart, their names, prices, quantities, and categories.

  • Checkout. Shopper starts the checkout process.

  • Checkout. Shopper enters a shipping address.

  • Checkout. Shopper chooses a shipping method.

  • Checkout. Shopper chooses a payment method.

  • Purchase. This includes the name of the StoreFront the purchase came through, order number, order total, tax amount, shipping cost, and coupon code if entered.

Note

It takes 24 hours for the first results in Google Analytics reports to populate.