Connect Google Analytics 4
GA4 tells Wren which marketing channels drive real revenue — not just traffic. You’ll connect using a Google Cloud service account, which is safer than sharing your personal Google login.
What you’ll need
- A Google Cloud account (free tier is fine)
- A GA4 property already installed on your store
- Your GA4 Property ID
Don’t have GA4 set up yet?
If you haven’t added GA4 to your WooCommerce store, start here:
- Go to analytics.google.com
- Create a new Analytics Account
- Add a web data stream with your store’s URL
- Install the measurement code on your store — most WooCommerce stores use a plugin like “Google Analytics for WooCommerce,” “GA Google Analytics,” or “Google Tag Manager for WordPress”
- Verify tracking is working in GA4’s real-time report
Note
For Wren to be useful, you should enable GA4 Ecommerce tracking. See our GA4 Ecommerce Setup guide after connecting.
Step 1: Enable the Google Analytics Data API
- Go to console.cloud.google.com
- Create a new project (or select an existing one)
- Navigate to APIs & Services › Library
- Search for “Google Analytics Data API”
- Click Enable
Step 2: Create a service account
- Go to IAM & Admin › Service Accounts
- Click Create service account
- Name it something like “wren-analytics”
- Click Create and continue
- Skip the optional role assignment — we’ll grant access in GA4 directly
- Click Done
Step 3: Create a JSON key
- Click on the service account you just created
- Go to the Keys tab
- Click Add Key › Create new key
- Select JSON and click Create
- The file downloads automatically — keep it safe
Step 4: Grant the service account access to GA4
- Open analytics.google.com
- Go to Admin (bottom left)
- Under Property Settings, click Property Access Management
- Click + (add users)
- Paste the service account email (found in the JSON file as
client_email— looks likewren-analytics@your-project.iam.gserviceaccount.com) - Set role to Viewer
- Click Add
Step 5: Find your GA4 Property ID
- Still in GA4 Admin
- Click Property Settings
- Copy the Property ID (just the number at the top, like
380515265)
Warning
Enter only the numeric ID (e.g.
380515265) — don’t include properties/ prefix.Step 6: Add to Wren
Open the JSON key file you downloaded. You’ll see fields like client_email, private_key, and project_id.
- In Wren, go to Settings › Store Connections › Google Analytics
- GA4 Property ID: paste the numeric ID (e.g.
380515265) - Service Account Email: paste
client_emailfrom the JSON - Private Key: paste
private_keyfrom the JSON — include the full-----BEGIN PRIVATE KEY-----...-----END PRIVATE KEY-----block - Project ID: paste
project_idfrom the JSON - Click Save Connections
Wren will pull the last 7 days of sessions and transactions on the next sync, then keep syncing nightly.