How to enable custom events tracking
Custom events send shopper actions to GA4: product views, search, add to cart, checkout, and purchase.
Prerequisites
- Measurement ID saved in the app
- Theme Extension active
- GA4 API Secret
How to get your GA4 API Secret
- Go to analytics.google.com
- Click Admin
- Under Property, click Data streams
- Open your Web stream (same one as your Measurement ID)
- Scroll to Measurement Protocol API secrets
- Click Create
- Enter a nickname (example:
Shopify App) - Click Create
- Copy the Secret value (shown once — save it somewhere safe)
- Paste it into AB: Google Analytics → Custom events → GA4 API Secret
- Click Save custom events
Steps
- Open AB: Google Analytics in Shopify Admin
- Scroll to Custom events
- Check Enable custom events tracking
- Paste your GA4 API Secret in the field
- Select the events you want:
App setting | What it tracks |
|---|---|
View category | Collection / category page views |
View item | Product page views |
Search | Store search |
Add to cart | Items added to cart |
Begin checkout | Checkout started |
Purchase | Completed orders |
- Click Save custom events

Where to see data in GA4
Open Google Analytics:
- Reports → Engagement → Events
- Reports → Monetization → Ecommerce purchases (for purchase data)
New events can take 24–48 hours to appear fully in some reports. Use Realtime for a quick test.
Common errors
"Save your Measurement ID first"
Complete Step 2 (Measurement ID) before saving custom events.
"API secret is required"
You must paste a valid GA4 Measurement Protocol API secret when custom events are enabled.
Need help?
Contact support in chat — tell us which events you enabled and we’ll help verify setup.
Updated on: 07/06/2026
Thank you!