Enabling Google Analytics for your store

Connect your online store to the free and powerful Google Analytics service. This way, you'll get access to lots of stats and insights into how your existing and potential customers find and use your store. Google Analytics 4 is based on events and parameters and allows you a lot of flexibility with custom report templates.

Starting July 1, you can set up Google Analytics 4 only as Universal Analytics stops processing data. Learn how you migrate to GA4 and make sure you connect a GA4 property in your store admin.
To empower your analytics, use the Google Tag Manager app from our App Market.

Creating a Google Analytics account and your store’s data stream

If you already have a Google Analytics account and a data stream for your store/website, you can proceed to the next section and connect it to your store.

If you don’t have a Google Analytics account, follow these steps to create it:

  1. Go to https://marketingplatform.google.com/about/analytics
  2. Click Get started today in the top right corner.
  3. Sign in to your Google Account or create a new Google/Gmail account.
  4. Click Start measuring.
  5. Fill in your Account name.
  6. Under Account Data Sharing Settings, check the boxes next to the options that you want.
  7. Click Next to create a property.
  8. Enter the property name (you can choose a name that suits you) and select a reporting time zone and currency.
  9. Click Next.
  10. Fill out the data about your business if you want, and click Create.
  11. Agree with the Google Analytics Terms of Service Agreement that opens.

Now you have a Google Analytics property for your site. Make sure to go to Admin → Data Streams → Web to create a stream for your store’s website. You can also check with Google instructions on how to get started →

Next, you’ll need to copy the Google tag ID and add it to your store admin panel to connect your store to Google Analytics. Read on to learn how.

Connecting your store to Google Analytics

It is really easy to connect your online store to your Google Analytics account. You can use a Google Analytics 4 property via "G-" ID or "GT-" ID.

When setting up Google Analytics 4, you get access to the opportunities of the brand-new Google tag, particularly to sending your store’s Analytics events to your Google Ads account. For that, Ads should be added as a Google tag destination, and the event should be a conversion event. Learn more about Google tag destinations

In case you were using Universal Analytics in your store, make sure you make a switch to Google Analytics 4 and paste a GA-4 ID in the Tracking & Analytics page in your store admin.

To connect via a Google Analytics 4 property:

  1. Sign in to your Google Analytics account.
  2. In the top left corner, click All Accounts:
    New GA menu.png
  3. From the opened list, choose your account and your GA4 property and click Open.
  4. In the menu on the left, click Admin and proceed to Data collection and modification → Data Streams.
  5. Click on the stream of your store/website:

    nabling Google Analytics for your store (9).png

  6. ● To use “G-” ID, copy the Measurement ID:

    Google

    ● To use “GT-” ID (available for properties created after July, 2022), scroll down and click Configure tag settings in the Google tag section, then copy your ID:

    nabling

  7. From your store admin, go to Settings → General → Tracking & Analytics.
  8. Paste the ID you’ve copied in the Google Analytics ID field:

    GA4

  9. Click Save or press Ctrl + S to save the changes.

That’s it. You’ve connected your store to Google Analytics 4.

Now the following events can be tracked:

  • page_view — views of store 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 someone adds a product to favourites
  • add_to_cart (with parameters) — when someone adds a product to cart
  • remove_from_cart (with parameters) — when someone removes a product from cart
  • share (with method and content_id parameters) – when someone shares a product using share buttons
  • begin_checkout (with parameters) — when someone begins checkout
  • add_shipping_info — when someone chooses a shipping method and proceeds with checkout
  • add_payment_info (with parameters) — when someone chooses a payment method and presses the “Place Order” button
  • purchase (with parameters) — when someone places an order

Learn about the reports and stats that you can get using Google Analytics 4

Note that the first results in Google Analytics reports will appear in about 24 hours.

Enabling tracking via Google’s Measurement Protocol API

After you connect your store to Google Analytics 4, you can additionally enable server-to-server tracking via Google's Measurement Protocol API. While this option is not mandatory, it allows you to collect the most accurate data about conversions in your online store.

For example, advanced tracking helps you deal with distortions in purchase tracking caused by customers using ad blockers or blocking 3d-party cookies. We also recommend tracking via Google’s API if your online payment methods don't redirect customers to the "Thank you for your order" page at checkout.

To use the Measurement Protocol API, you’ll need to create a new secret for your store’s data stream in Google Analytics and paste it into your store admin.

To enable advanced tracking via Google’s API:

  1. Sign in to your Google Analytics account and go to Admin → Data Streams.
  2. Click on the stream of your store/website.
  3. On the opened tab, scroll down and click Measurement Protocol API secrets.
  4. Review the User Data Collection Acknowledgement and click Create to add a new API secret.
  5. Enter a nickname for your secret (for example, “Online store”) and click Create.
  6. Copy the secret value for your API secret:
    Enabling tracking via Google’s Measurement Protocol API.png
  7. From your store admin, go to Settings → General → Tracking & Analytics and paste the secret you’ve copied in the Google's Measurement protocol API key for Google Analytics 4 field.
    The field appears after you connect GA4 to your store.
  8. Save the changes.

That’s it!

You’ve enabled advanced tracking via Google’s Measurement Protocol API for your store. Now, data on purchase events will be sent directly from store servers to Google Analytics servers.

Was this article helpful?

Awesome! Thanks for your feedback!

Thanks for your feedback!

Sorry about that! What went wrong?
22 out of 26 found this helpful
We use cookies and similar technologies to remember your preferences, measure effectiveness of our campaigns, and analyze depersonalized data to improve performance of our site. By choosing «Accept», you consent to the use of cookies.
Accept cookies Decline