Google Analytics 4

Effortlessly setup and send your data to Google Analytics 4.


Google Analytics 4 (GA4) is the latest version of Google's web site analytics platform. It's designed to offer more advanced and flexible tracking and analysis capabilities compared to its predecessor, Universal Analytics (UA). Google Analytics is built around an event-driven model, which means you can track a wide range of user interactions and events on your website. This is especially valuable for e-commerce, as you can track not only traditional pageviews but also specific actions and chain of events, such as the entire purchase journey. This includes tracking product views, add to cart actions, checkouts, and to track purchases, allowing you to gain deep insights into your e-commerce sales funnel. Knowledge that is critical when working on your customers experience on your site and with your marketing campaigns.

Connect Shopify to Google Analytics

Shopify provides a range of tools and services to help users create, customize, and manage their online storefronts without requiring extensive technical expertise. Shopify is known for its user-friendly interface and wide variety of features designed to support online selling. But the default Google Analytics plugin for connecting Shopify to Google Analytics is not as comprehensive as merchants tend to require, and it often results in mismatches between Shopify Analytics and Google Analytics reports. Among other things it fails to properly report conversions, attribution and data completeness in general. Critical shortcomings that we are addressing with the Zubi connection for Shopify and Google Analytics.

How it works

Zubi runs both client-side and server-side, which makes it more robust when tracking conversion events on a Shopify site. The client-side implementation essentially implements Google's Global Site Tag to track and capture events occurring directly in the browser. But client-side Google tag tracking has a few shortcomings when it comes to your Shopify store and conversion events. Mainly it sometimes fails to track conversions because of various tracking blockers or privacy settings when listening only for browser events. To address this, and to enable a wider event tracking, Zubi use Shopify web-hooks and server-side tracking to ensure all conversions are captured and correctly attributed.

Combining client-side and server-side tracking increases data accuracy on conversion events to 100%. If purchase transactions aren't tracked directly on the web page, we receive a backend notification from the webhooks that we use to push the transaction to your Google Analytics account so the transaction can be recorded properly. If you integrate your Google Analytics account with your Google Ads account, this also means that Google Ads will get better conversion data.

What you can track

TypeEventDescription
Client-sidepage_viewPage views are triggered when a user views a web page.
Client-sideadd_to_cartAdd to cart events are triggered when an item is added to cart.
Client-sidepurchaseTriggered from the standard 'thank you'-page.
Client-sideview_item_listTracks when a user has seen a product in a list of products.
Client-sideview_itemTracks when a user views a specific item or product detail page.
Client-sideremove_from_cartTriggered when an item is removed from cart.
Server-sidebegin_checkoutTracks when a user has started checkout.
Server-sideadd_shipping_infoTracks when a user has added shipping info.
Server-sideadd_payment_infoTracks when a user has submitted payment information.
Server-sidepurchaseTriggered server-side when a purchase is made.
Server-siderefundTriggered when a refund is webhook is fired.

Installation guide

Credentials

Scroll down to the Get the required credentials section below to learn how you find the credentials required.

This guide will show a simple setup process to install the integration to Google Analytics from Shopify via Zubi. It assumes that you have a Google Analytics account and a Shopify store in place. Furthermore, this guide includes setting up and enable ecommerce conversion tracking for Google Ads. This is however completely optional and can be safely discarded if not of interest to you.

Install the Zubi app

Get started by installing the Zubi app from the Shopify app store. In your shop admin panel, go to the Shopify app store and search for Zubi Analytics. Click Add App and then install app to install the application.

Once installed, either click create account to setup Zubi with a new account, or add your api key and click connect to return to an existing account. Connecting your Shopify store to Zubi deploys the Zubi tracker code to your site.

Enable enhanced ecommerce tracking and speed boost

The Zubi app comes with a feature to boost tracking and page speed that we strongly recommend that you deploy. Simply click the button and tick the box to add it to your theme.

Set up Google Analytics

Provide a Measurement ID to connect Google Analytics client-side tracking, and the Measurement Protocol API secret to initiate server-side tracking (both options are highly recommended), then click Save to store your settings.

Setup Google Ads (optional)

The Shopify to Google Ads integration use the Google Enhanced Conversion server-side solution together with client-side tracking to send accurate conversion data to Google Ads. We recommend to setup both client-side and server-side tracking, but if you like to use only one or the other you may do so.

Client-side tracking requires the Conversion ID and the Conversion Label to be set, while the server-side tracking requires the Google Ads Customer ID and the Conversion Action ID to be provided.

Remove old Google Analytics code

Make sure to remove any old global site tag or any other google analytics plugins to avoid duplicates and conflicts in your tracking. Easiest way to do this is of course to deactivate any app you may have for this, and then search the theme files for your Google Analytics id or tracking id, and remove everything you find.

All set!

That's it, you are all set and good to go with better Shopify data in Google Analytics.


Connect WooCommerce to Google Analytics

Using Google Analytics with WooCommerce, which is a popular e-commerce plugin for WordPress, offers several advantages for online retailers and businesses. Google Analytics provides robust e-commerce tracking features for your woocommerce store that allow you to monitor key metrics related to your online store, such as revenue, conversion rates, traffic sources, and average order value. Based on this store data, and user behavior, you can gain insights into product performance, sales channels, and customer behavior.

How it works

The Woocommerce Google Analytics integration tracks conversions server side by default, but you need to enable server-side tracking in Zubi to actually send the event to Google Analytics 4. Server-side conversion tracking is also a great solution if you use a custom thank you page and/or use a cache plugin that could negatively impact tracking (even though Zubi works with most cache plugins, issue may occur).

What you can track

TypeEventDescription
Client-sidepage_viewPage views are triggered when a user views a web page.
Client-sideadd_to_cartAdd to cart events are triggered when an item is added to cart.
Client-sidepurchaseTriggered when an order is completed.
Client-sideview_item_listTracks when a user has seen a product in a list of products.
Client-sideview_itemTracks when a user views a specific item or product detail page.
Client-sidebegin_checkoutTracks when a user has started checkout.
Client-sideremove_from_cartTriggered when an item is removed from cart.
Server-sidepurchaseTriggered server-side when a purchase is made.

Installation guide

Credentials

Scroll down to the Get the required credentials section below to learn how you find the credentials required.

Add Google Analytics

Log in to Zubi to connect Google Analytics and optionally setup conversion tracking in Google Ads. Start by going to Data Platform > Integrations and select the Google Analytics 4 integration. From there, simply set the Measurement ID (G-XXXXXXXXXX) for your data stream, found in your Google account. You may use one of your existing Google Analytics properties, or create a new property.

If you want to track conversions in Google Ads, include the Conversion ID and Conversion Label before saving the integration.

Uninstall any old global site tag or Google Analytics plugins

Remove or deactivate any other plugin for Google Analytics to avoid conflicts and duplicate events. If you manually added any global site tag, you should remove that as well.

All done!

That's it, you are all set with the Woocommerce Google Analytics integration.


Connect other platforms

Any website or platform can use Zubi to send better data to Google Analytics. Some events are tracked right out of the box, while others may require specific setup of the event for Zubi to track them. Using a completely manual setup of Zubi requires that the Zubi events are added in code to the platform. A full overview of all events, and how they are setup can be found here .

How it works

The Google Analytics 4 integration activates the Google site tag, which means it sends the events to Google Analytics 4 directly from the browser. Just like setting up Google Analytics yourself, but with predefined events to capture more data. You can extend this implementation using either code or the Tag Manager just as you would if you installed Google Analytics 4 yourself.

In addition, you can send data server-side to Google Analytics 4 using the server-side integration available in Zubi. This integrations also enables Zubi to send audience data to Google Analytics 4. Use it to tag users with custom segments from Zubi that can be used to create audiences for improved marketing.

Mapped events

The following events are mapped out-of-the-box for you when you activate the Google Analytics 4 integration. All of these events will be available in Google Analytics, and all data in Google Analytics can be used for dynamic ads and remarketing in Google Ads.

TypeEventDescription
Client-sidepage_viewPageviews are tracked automatically.
Client-sideadd_to_cartTriggered when a Zubi 'Added to Cart' event occurs.
Client-sidepurchaseTriggered when a Zubi 'Order Completed' event occurs.
Client-sideview_item_listTriggered when a Zubi 'Product Seen' event occurs.
Client-sideview_itemTriggered when a Zubi 'Product Viewed' event occurs.
Client-sidebegin_checkoutTriggered when a Zubi 'Checkout Started' event occurs.
Client-sideremove_from_cartTriggered when a Zubi 'Removed From Cart' event occurs.
Client-sideview_promotionTriggered when a Zubi 'Promotion Viewed' event occurs.

Installation guide

Credentials

Scroll down to the Get the required credentials section below to learn how you find the credentials required.

Client-side tracking

  • Log into your Zubi account
  • Go to Data Platform > Integrations and select the Google Analytics 4
  • Set the GTAG ID (measurement ID: G-XXXXXXXXXX)
  • Track Google Ads conversions by adding a Conversion ID and Conversion Label.
  • Get your Conversion ID and Conversion Label Make sure to include AW- in the Conversation ID

Server-side tracking

  • Log into your Zubi account
  • Go to Data Platform > Integrations and select the Google Analytics 4 - Server Side
  • Set your Measurement ID and API Secret, then click Save.

Send audience data

  • Log into your Zubi account
  • Go to Data Platform > Integrations and select the Google Analytics 4 - Send audience data
  • Set your Measurement ID and API Secret, then click Save.

Get the required credentials

Measurement ID

  • Log into your Google Analytics account
  • Go to Admin > Data Streams and click on the stream
  • You'll find your Measurement ID in top right corner (G-xxxxxxxxxx)

API Secret

  • Log into your Google Analytics account
  • Go to Admin > Data Streams and click on the stream
  • Scroll down and click on Measurement Protocol API Secrets
  • Click Create in the top right corner to create your secret
  • Set any nickname you like and click Create

Conversion ID

Follow these steps to get your conversion ID. If you don't have any setup yet, create a new one in step 3.

  • In your Google Ads account, click Goals in the menu.
  • Select Summary, which opens to the Conversion Actions table.
  • Select the conversion that you want to use from the Conversion action column You cannot use goals that have Google Analytics 4 as source or create a new.
  • Expand the tab for Tag setup to view the tag details.
  • Select Use Google Tag Manager.
  • Scroll to the code snippet section and look for the Conversion ID.
  • Make sure to include the AW- prefix in the ID when adding it. E.g. AW-123456789

Conversion Label

  • Continue from the instrucitons above.
  • On the same page as you found your Conversion ID, just below you will find your Conversion Label.

Conversion Action ID

You have to activate Enhanced Conversions in Google Ads for the conversion action you want to enhance.

Activate Enhanced Conversions

  • Log into your Google Ads account
  • Go to Tools and Settings > Measurements > Conversions
  • Click on the conversion action you want to use and scroll down to Enhanced Conversions
  • Click the Turn on Enhanced Conversions , then select API and click Next > Save

Get the Conversion Action ID

  • Log into your Google Ads account
  • Go to Tools and Settings > Measurements > Conversions
  • Click on the conversion action you want to use and scroll down to Enhanced Conversions
  • In the browser URL, find &ctId= and copy the value between ctId= and the next &
  • This is your Conversion action id (ctId= 123456789 &)

Troubleshooting

Check for client-side events

Test it with the tagassistant from Google.

  • Open the Google tag assistant and add your domain
  • Browse the store and make sure to perform all the action from which you expect to receive an event.
  • Evaluate the result by checking all the events that has been collected in Google Analytics 4

Privacy considerations

Cookies and PII

We do not collect any data or set any cookies particularly for this feature. But Google Analytics does, read more about it in the link below.

TypeNameDescription
ClientGooglehttps://support.google.com/analytics/topic/2919631?hl=en&ref_topic=1008008&sjid=17252752645508035067-EU

Regulatory compliance

We work hard to stay transparent around data privacy and protection. To help our customers with regulatory compliance and transparency towards their users, we have documented all data usage within our platform from a data privacy perspective, and provided recommendations on how to use our platform in a compliant way. Start here .