Connecting Google Analytics 4 (GA4) to Your SHOPLINE Store
Google Analytics 4 (GA4) is Google’s latest analytics platform that can be used to provide deeper insights into customer behavior, traffic patterns, and conversion performance across your online store. By correctly setting up GA4 and connecting it to your SHOPLINE store, you can collect accurate, privacy-friendly, and comprehensive data to support marketing and business decisions.
This guide explains how to create a GA4 account and property, set up a data stream, and connect GA4 using both client-side and server-side reporting methods supported by SHOPLINE.
Introducing Google Analytics
Google Analytics is a free analytics tool that collects data about how visitors interact with your website. It provides detailed reports on traffic sources, page performance, user journeys, and conversions, helping you:
- Understand how customers find and navigate your store
- Evaluate marketing and advertising performance
- Identify opportunities to improve conversions and user experience
- Make data-driven business decisions
GA4 uses the Google tag (gtag.js) to collect event-based data such as page views, scrolls, purchases, and other interactions. It can also receive server events and Measurement Protocol data for more accurate reporting.
Creating and Setting Up a Google Analytics Account
Before connecting GA4 to your SHOPLINE store, you must create a Google Analytics account and set up a GA4 property for your website. This process includes creating an account (if you don’t already have one), creating a GA4 property, and adding a Web Data Stream for your store domain.
Because Google Analytics may update its interface and setup flow periodically, we recommend following Google’s official documentation: "Set up Analytics for a website and/or app" for the most accurate and up-to-date guidance.
After you have created your GA4 account, property, and Web Data Stream, return to this article to continue the connection steps within SHOPLINE.
Setting Up Data Collection in SHOPLINE
SHOPLINE supports two types of GA4 reporting methods:
- Client-side reporting: Tracking code loads in the browser.
- Server-side reporting (Measurement Protocol): Events are sent from the server for improved accuracy.
You can enable client-side reporting alone or enable both client-side and server-side reporting.
Client-Side Data Reporting
Client-side reporting tracks GA4 events through the Google tag running in the shopper’s browser. This allows GA4 to record page views, clicks, conversions, and more. However, tracking may be affected by ad blockers, privacy restrictions, or disabled JavaScript.
To enable client-side reporting, follow these steps:
-
In Google Analytics, go to Admin > Property settings > Data collection and modification > Data streams, then select your stream.
-
In Stream details, locate and copy the MEASUREMENT ID (G-XXXXXXX). Save it for later use.
-
Return to your SHOPLINE admin panel and go to Channels > Google > Data tracking, then click Manage (or Start tracking if no data tracking has been configured).
-
Locate the Google Analytics section and click Add.
-
In the pop-up window:
- Select Google Analytics 4 (GA4) as your Property Type.
- Paste the Measurement ID into the Code ID field.
- Click Complete to save the settings.
Server-Side Data Reporting
Server-side reporting sends events directly from the server to GA4, bypassing browser limitations. This method:
- Works even if users block cookies or scripts
- Improves tracking accuracy
- Reduces reliance on client-side JavaScript
- Better aligns with privacy regulations such as GDPR
- Helps minimize data loss caused by ad blockers
To enable server-side reporting, you need to provide both the Measurement ID and the Measurement Protocol API Secret from your GA4 Web Data Stream. Follow these steps:
-
In Google Analytics, go to Admin > Property settings > Data collection and modification > Data streams, then select your stream.
-
In Stream details, locate and copy the MEASUREMENT ID (G-XXXXXXX). Save it for later use.
-
Scroll down to the Events section and click Measurement Protocol API secrets.
-
In the Measurement Protocol API secrets pop-up window, click Create.
-
In the Create new API secret window, name your API secret and click Create to generate the Secret value.
-
Copy the generated Secret value and keep it in a secure location.
-
Return to your SHOPLINE admin panel and go to Channels > Google > Data tracking, then click Manage (or Start tracking if no data tracking has been configured).
-
Locate the Google Analytics section and click Add.
-
In the pop-up window:
- Select Google Analytics 4 (GA4) as your Property Type.
- Paste the Measurement ID into the Code ID field.
- Paste the Secret value into the Google Analytics API Secret field.
- Click Complete to save the settings.
|
Required GA4 Settings After Enabling Server-Side Reporting: To prevent duplicate or conflicting data, update the following setting inside GA4:
If this option remains enabled, GA4 may record duplicate event parameters or mismatched conversion values. |
Setting Up Conversion Goals
Once your GA4 connection is complete, you can configure conversion events to measure specific actions on your SHOPLINE store.
Typical conversions include:
- Purchases
- Add-to-cart
- Begin checkout
- Sign-ups or lead form submissions
You can configure or modify conversions directly in GA4. For detailed steps, see "Creating and managing conversions"