Shopify has integrated Google Analytics 4 natively since 2023. The install takes less than 10 minutes and doesn't require touching the theme code. Here's how to proceed and how to verify the tracking works correctly.
Before you start
You need:
- Owner access or staff with "Online Store" permissions
- A GA4 property created with its Measurement ID (
G-XXXXXXXXXX)
If you haven't created your GA4 property yet, start with the general GA4 install guide.
Official method: Google & YouTube Channel in Shopify
This is the method recommended by Shopify and Google. It connects GA4 via the Google sales channel.
Step 1: install the Google & YouTube channel
- In Shopify admin → Sales channels → +
- Search "Google & YouTube"
- Add channel
If the channel is already installed (it is on most stores), skip straight to step 2.
Step 2: connect GA4
- In Shopify → Google & YouTube → Settings
- "Google Analytics" section
- Click "Connect Google Analytics"
- Select your Google account → your GA4 property
- Validate
Shopify automatically injects the GA4 tag on every store page, including the checkout funnel.
Step 3: enable enhanced e-commerce data
- In Shopify admin → Google & YouTube → Settings
- Enable "Share data with Google Analytics"
- Select the sharing level: "Google Analytics and Google products" (recommended)
Shopify then automatically sends the standard e-commerce events: view_item, add_to_cart, begin_checkout, purchase.
Alternative method: Shopify Pixel with the GA4 ID
If the Google channel method doesn't work or if you want more control:
- Shopify admin → Settings → Customer events
- Add pixel
- Select "Add custom code"
- Paste this code replacing
G-XXXXXXXXXXwith your GA4 ID:
analytics.subscribe("page_viewed", () => {
gtag("config", "G-XXXXXXXXXX");
});
- Enable the pixel
This method is more technical but gives full control over the events sent to GA4.
Verify that tracking works
Quick real-time test
- Open your Shopify store in a private window
- Navigate through a few pages (home, a product page, the cart)
- In GA4 → Reports → Realtime
- You should see yourself as an active visitor
Verify e-commerce events
- Add a product to the cart (or start a checkout)
- In GA4 → Realtime → "Key events" section
- You should see
add_to_cartorbegin_checkoutappear
If the events appear, e-commerce tracking is correctly configured.
Common issues with Shopify + GA4
Checkout isn't tracked
Shopify requires your plan to include checkout customisation to track conversions properly. On Basic plans, the checkout funnel is limited. If you see GA4 sessions but zero purchase events, it's probably tied to Shopify permissions.
GA4 Monetisation data stays at zero
Verify the "Share data with Google Analytics" option is enabled in the Google & YouTube channel. Without it, Shopify sends events but no monetary values.
Gap between Shopify orders and GA4
That's normal. GA4 has a 24 to 48-hour processing delay. Today's data is never complete. For real time, use Shopify's built-in reports.
Difference with the GA4 e-commerce guide
This article covers the GA4 tag install on Shopify. If your tag is in place and you now want to analyse e-commerce performance (revenue by channel, purchase funnel, top products), see:
→ GA4 e-commerce: Shopify and WooCommerce tracking: how to read and exploit the data once tracking is in place.
After the install
- Change data retention to 50 months in GA4 → Admin → Data retention
- Mark the
purchaseevent as a conversion in GA4 → Admin → Conversions - GDPR / Consent setup: see GA4 and GDPR cookies consent
If you manage GA4 for multiple Shopify stores, NarratIQ centralises their properties in a single dashboard and generates the monthly PDF report in 30 seconds per client.
Install guides on other platforms
- GA4 install: general guide: the full procedure with property creation, verification and post-install setup
- Install GA4 on WordPress: for WordPress and WooCommerce sites
- Install GA4 on Next.js: for custom React/Next.js sites