📊
Commerce Ace · App Guide

GA4 Agent

Plain-English analytics and a weekly insights digest, pulled straight from your Google Analytics 4 property — ask questions in plain English, get real answers.

Step 0

Before you start

A few things need to be in place before GA4 Agent can connect to your analytics. Skim both lists — the second one saves support tickets later.

Requirements
  • An active Shopify plan with GA4 Agent installed from the Commerce Ace listing.
  • A Google Analytics 4 property already set up for your Shopify store — you'll need both the Measurement ID and Property ID.
  • A Google account with Admin or Analyst access to that GA4 property — Viewer access is not sufficient for the OAuth connection.
  • At least a few weeks of GA4 data — fresh properties with little to no history won't have much to report on.
  • A Commerce Ace Pro plan for the Analytics Agent (natural language queries). Starter and Growth plans get event tracking only.
Out of scope
  • ×GA4 Agent reads and explains your data — it does not change your GA4 configuration or create new properties.
  • ×It reports on GA4 data only — not Shopify's native analytics dashboard or Shopify reports.
  • ×GA4 processes data with a 24–48 hour delay — questions about today's activity won't return results yet.
  • ×It doesn't store or export raw user-level data — all queries return aggregated, anonymized results.
Setup

Step-by-step setup

Nine steps from install to querying your analytics in plain English.

01

Install on Shopify

From the Commerce Ace listing, click Install. GA4 Agent opens in your Shopify admin under Apps — no separate login required. Once open, click Settings to begin configuration.

Tip Have your GA4 account open in another tab — you'll need your Measurement ID and Property ID in the next step.
Step 1 — Install on Shopify
View full size
02

Settings — GA4 Connection

In Settings, under GA4 Connection, enter your Measurement ID and GA4 Property ID. These are two different identifiers — both are required.

Measurement ID starts with "G-" and is found in GA4 → Admin → Data Streams → your stream → Measurement ID. This connects the tracking script to your GA4 property.

GA4 Property ID is a numeric-only ID found in GA4 → Admin → Property Settings → Property ID (top right). This is required for Pro plan analytics queries — without it, the Analytics Agent cannot run queries against your data.

Click Save Settings when done.

Tip The Measurement ID and Property ID are different things. The Measurement ID (G-XXXXXXXX) handles tracking. The Property ID (numbers only) handles data queries. You need both.
Step 2 — GA4 Connection Settings
View full size
03

Settings — Data Layer

The Data Layer is the tracking script that sends ecommerce events from your Shopify storefront to Google Analytics 4. Without it enabled, GA4 only receives page views — not add-to-cart, checkout, or purchase events. Those events are what make your analytics actually useful for ecommerce decisions.

Click Enable to activate the Data Layer. The status badge will turn green and show Active. GA4 Agent injects the gtag.js tracking script and ecommerce event listeners directly into your theme via Shopify's Theme App Extension — no theme code edits required.

Click Disable at any time to deactivate tracking without uninstalling the app.

Tip After enabling, visit your storefront and check GA4 → Admin → DebugView to confirm events are firing in real time. It may take a few minutes to appear.
Step 3 — Data Layer
View full size
04

Settings — Extended Event Tracking

Extended Event Tracking unlocks additional GA4 ecommerce events beyond the core four. Available on Growth and Pro plans, these events give you a much richer picture of shopper behavior on your storefront.

When enabled, the following events fire automatically:

view_item — fires when a shopper views a product detail page. Tells you which products get the most attention.
view_item_list — fires on collection page loads. Shows which collections drive the most engagement.
select_item — fires when a shopper clicks a product from a list. Tracks click-through rate from collections.
view_cart — fires when a shopper opens the cart. Helps identify cart abandonment patterns.
remove_from_cart — fires when an item is removed from the cart. Signals which products shoppers reconsider.
view_promotion — fires when a banner or promotional element is viewed.
search — fires when a store search is performed. Reveals what shoppers are looking for that they can't find.

Tip Extended events give the Analytics Agent much more to work with. "Which products have the highest view-to-cart rate?" only works if view_item and add_to_cart are both firing.
Step 4 — Extended Event Tracking
View full size
05

Settings — Google Account Connection

The Google Account Connection section is where you authorize GA4 Agent to query your GA4 data on your behalf. This uses Google OAuth — a secure, industry-standard authorization flow. You never share your Google password with Commerce Ace.

Click Connect Google Account and log in with the Google account that has Admin or Analyst access to your GA4 property. Once authorized, you'll see a green checkmark and the message "Google account connected." — this confirms the connection is active and the Analytics Agent can run queries.

The Disconnect button revokes the OAuth connection. Use it if you need to switch Google accounts or if you're troubleshooting a "Failed to query GA4" error — disconnecting and reconnecting generates a fresh token. Note: Google OAuth tokens expire periodically as a security measure. If queries suddenly stop working, reconnecting your Google account will resolve it.

Tip Make sure the Google account you connect has been added to your GA4 property with at least Analyst access. Go to GA4 → Admin → Property Access Management to verify or add it.
Step 5 — Google Account Connection
View full size
06

Event Tracking — Core & Extended Events

The Event Tracking page shows you exactly which GA4 events are active and firing from your storefront. Events are split into two groups.

Core Events (Starter+) are the four fundamental ecommerce events: page_view fires on every page load, add_to_cart fires when a product is added to the cart, begin_checkout fires when checkout is started, and purchase fires on the thank you page after an order completes. These four events alone give you funnel visibility from browse to purchase.

Extended Events (Growth+) are the seven additional behavioral events described in Step 04 — view_item, view_item_list, select_item, view_cart, remove_from_cart, view_promotion, and search. Each shows an Active status badge when firing correctly.

At the bottom of the page, the Verify in GA4 DebugView note reminds you to confirm events are flowing. Visit your storefront, trigger a few actions (add to cart, begin checkout), then check GA4 → Admin → DebugView to see them appear in real time.

Tip If an event shows Active but you're not seeing it in GA4 DebugView, clear your browser cache and try again. DebugView can take 1–2 minutes to update.
Step 6 — Event Tracking
View full size
07

Analytics Agent — Ask Your First Question

The Analytics Agent is the Pro plan feature that turns your GA4 data into plain-English answers. No dimension IDs, no metric names, no spreadsheets — just type a question and Claude queries your GA4 property and explains the result.

Click Analytics Agent in the app nav. You'll see an information banner reminding you that GA4 processes data with a 24–48 hour delay — questions about today's activity won't return results yet. Ask about the last 7, 30, or 90 days for the most reliable answers.

Type your question in the input field and click Ask. Claude will query your GA4 data and return a structured response with key insights and actionable opportunities. The conversation is persistent — you can ask follow-up questions and Claude maintains the context of previous answers in the same session.

Click Clear Conversation (top right of the chat) to start a fresh session. Use this when switching topics — for example, after asking about traffic sources, clear the conversation before asking about product performance so Claude doesn't carry over irrelevant context.

Tip The more specific your question, the better the answer. "What were my top 5 products by revenue in the last 30 days?" beats "how are my products doing?" — specificity gives Claude the exact dimensions and date range to query.
Step 7 — Analytics Agent
View full size
08

Theme Editor — GA4 Data Layer Embed

After enabling the Data Layer in Settings, you need to confirm it's active in your theme. Go to Shopify Admin → Online Store → Themes → Customize → App Embeds. You'll see GA4 Data Layer listed under Commerce Ace GA4 Agent. The toggle should be on — if it isn't, enable it and save the theme.

This embed is what physically injects the GA4 tracking script into every page of your storefront. Without it toggled on in App Embeds, the Data Layer setting in the app has no effect — events will not fire to GA4 even if the status shows Active.

You'll also see your GA4 Measurement ID displayed here (read-only) — confirming which property the embed is connected to. The Plan field shows your current Commerce Ace plan and is managed automatically. If you need to change your plan, click Manage app to go directly to the GA4 Agent settings.

Tip If events aren't showing in GA4 DebugView even after enabling the Data Layer, check this App Embeds toggle first — it's the most common reason tracking doesn't fire.
Step 8 — Theme Editor GA4 Data Layer
View full size
09

Verify in GA4 DebugView

GA4 DebugView is a real-time event monitor built into Google Analytics 4. It shows every event firing from your storefront as they happen — before the 24–48 hour processing delay. This is the most reliable way to confirm your tracking is working correctly after setup.

To access DebugView, go to your GA4 property → Admin → DebugView. You'll see a timeline of events on the left and event details on the right. To trigger events, open your storefront in a separate browser tab and perform actions — view a product, add something to cart, begin checkout, complete a purchase.

Here's what to look for and what each event confirms:

page_view — should fire on every page load. If this isn't showing, the Data Layer embed is not active. Check App Embeds in Theme Editor first.
add_to_cart — fires when a product is added to the cart. If missing, the tracking script may not have loaded on your product page.
begin_checkout — fires when checkout is initiated. If missing, verify the checkout button is triggering the event.
purchase — fires on the thank you page after an order. This is the most critical event for revenue data. If missing, it may be a Shopify checkout theme limitation — contact Commerce Ace support.
view_item, view_item_list, select_item, view_cart, remove_from_cart, search — Extended Events (Growth+). These should fire when you view a PDP, browse a collection, click a product card, open the cart, remove an item, or use the search bar respectively.

If events are not appearing in DebugView after 2–3 minutes, run through this checklist: confirm the GA4 Data Layer toggle is on in Theme Editor App Embeds, confirm the Measurement ID in Settings matches the one in your GA4 Data Stream, clear your browser cache and try again, and make sure you're browsing the live published theme — not a preview theme.

Tip DebugView only shows events from devices in debug mode. In Chrome, install the Google Analytics Debugger extension — it puts your browser into debug mode so your events appear in DebugView without affecting real visitor data.
Step 9 — Verify in GA4 DebugView
View full size
Settings

Configuration guide

Every setting lives under GA4 Agent → Settings. Here's what each field controls and what to put in it.

SettingWhat it doesRecommended
Measurement ID The GA4 tracking identifier used to connect your storefront to your GA4 property. Starts with "G-". Found in GA4 → Admin → Data Streams → your stream. Copy exactly from GA4 — it's case sensitive
GA4 Property ID The numeric identifier for your GA4 property. Used by the Analytics Agent to run queries via the GA4 Data API. Found in GA4 → Admin → Property Settings (top right). Numbers only — no "G-" prefix. Required for Pro plan Analytics Agent queries
Data Layer Enable/Disable toggle for the ecommerce tracking script. When Active, injects gtag.js and core ecommerce events into your theme via Theme App Extension. Enable — required for any GA4 ecommerce data
Extended Event Tracking Activates 7 additional behavioral events: view_item, view_item_list, select_item, view_cart, remove_from_cart, view_promotion, search. Growth and Pro plans only. Enable on Growth+ — richer data = better Analytics Agent answers
Google Account Connection OAuth connection to your Google account. Required for the Analytics Agent to query your GA4 Data API. The connected account must have Admin or Analyst access to the GA4 property. Connect with your GA4 admin account. Reconnect if queries stop working.
Best practices

Merchant recommendations

What we tell every Commerce Ace merchant on their onboarding call.

Verify events in DebugView before trusting data

After enabling the Data Layer, open your storefront in a browser, add something to cart, begin checkout — then check GA4 → Admin → DebugView. You should see events flowing in real time. If they're not there, the tracking isn't working and your analytics data will have gaps.

Ask about geography first

"Top states by sessions this month" is one of the most immediately actionable queries. It tells you where your real audience is and where to focus ad spend — information that's buried in GA4 but takes one question here.

Replace your Monday morning spreadsheet

Ask "Compare this week to last week across sessions, revenue, and conversion rate" every Monday. Claude will pull the numbers, calculate the changes, and highlight what moved — in plain English, in seconds.

Ask about traffic sources, not just volume

"Which channels drove the most revenue last week?" is more valuable than "how many sessions did I get?" Revenue by channel tells you what's actually working — not just what's driving clicks.

Use Clear Conversation when switching topics

The Analytics Agent maintains context across a session. If you've been asking about traffic and then want to ask about products, clear the conversation first — it prevents Claude from mixing context between unrelated queries.

Always include a time range in your question

"Last 7 days" vs "last 30 days" can tell very different stories — especially after a promotion or seasonal spike. Including the time range in your question ensures Claude queries exactly the window you care about.

FAQ

Frequently asked

Do I need to know GA4 to use the Analytics Agent?

No — that's the point. You ask in plain English and Claude translates it into a GA4 Data API query, runs it, and explains the result. No dimension IDs, no metric names, no spreadsheets required.

What's the difference between Measurement ID and Property ID?

The Measurement ID (starts with "G-") connects your storefront tracking script to GA4. The Property ID (numbers only) is what the Analytics Agent uses to query your data via the GA4 Data API. Both are required for the full feature set — Measurement ID for tracking, Property ID for querying.

Why can't I see revenue or purchase data?

Revenue data requires the GA4 purchase event to be firing from your storefront. Enable the Data Layer in Settings and verify the purchase event is active in GA4 DebugView. If it's not firing, the tracking script may not have loaded on your thank you page — check your theme's checkout settings.

Why am I getting "Failed to query GA4"?

This almost always means your Google OAuth connection has expired. Google periodically revokes tokens as a security measure. Go to Settings → Google Account Connection → Disconnect, then reconnect your Google account. This generates a fresh token and resolves the error.

Why does the Analytics Agent say data isn't available yet?

GA4 processes data with a 24–48 hour delay. If you're asking about today or yesterday, the data may not be fully processed yet. Ask about the last 7 or 30 days for the most reliable results. Real-time event verification should be done through GA4 DebugView, not the Analytics Agent.

Can I disconnect and reconnect Google with a different account?

Yes — click Disconnect in Settings → Google Account Connection, then reconnect with a different Google account. Make sure the new account has Admin or Analyst access to your GA4 property, or queries will fail.

Does it have access to individual user data?

No. The Analytics Agent queries aggregated data only — sessions, events, conversions, and revenue by dimension. It never accesses individual user profiles, email addresses, or any personally identifiable information from your GA4 property.