Articles on: AB : Google Analytics

How to enable custom events tracking

Custom events send shopper actions to GA4: product views, search, add to cart, checkout, and purchase.

Prerequisites


  1. Measurement ID saved in the app
  2. Theme Extension active
  3. GA4 API Secret



How to get your GA4 API Secret


  1. Go to analytics.google.com
  2. Click Admin
  3. Under Property, click Data streams
  4. Open your Web stream (same one as your Measurement ID)
  5. Scroll to Measurement Protocol API secrets
  6. Click Create
  7. Enter a nickname (example: Shopify App)
  8. Click Create
  9. Copy the Secret value (shown once — save it somewhere safe)
  10. Paste it into AB: Google AnalyticsCustom eventsGA4 API Secret
  11. Click Save custom events


Steps


  1. Open AB: Google Analytics in Shopify Admin
  2. Scroll to Custom events
  3. Check Enable custom events tracking
  4. Paste your GA4 API Secret in the field
  5. 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

  1. Click Save custom events





Where to see data in GA4


Open Google Analytics:

  • ReportsEngagementEvents
  • ReportsMonetizationEcommerce 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

Was this article helpful?

Share your feedback

Cancel

Thank you!