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:

  1. Go to analytics.google.com
  2. Create a new Analytics Account
  3. Add a web data stream with your store’s URL
  4. 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”
  5. 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

  1. Go to console.cloud.google.com
  2. Create a new project (or select an existing one)
  3. Navigate to APIs & Services › Library
  4. Search for “Google Analytics Data API”
  5. Click Enable

Step 2: Create a service account

  1. Go to IAM & Admin › Service Accounts
  2. Click Create service account
  3. Name it something like “wren-analytics”
  4. Click Create and continue
  5. Skip the optional role assignment — we’ll grant access in GA4 directly
  6. Click Done

Step 3: Create a JSON key

  1. Click on the service account you just created
  2. Go to the Keys tab
  3. Click Add Key › Create new key
  4. Select JSON and click Create
  5. The file downloads automatically — keep it safe

Step 4: Grant the service account access to GA4

  1. Open analytics.google.com
  2. Go to Admin (bottom left)
  3. Under Property Settings, click Property Access Management
  4. Click + (add users)
  5. Paste the service account email (found in the JSON file as client_email — looks like wren-analytics@your-project.iam.gserviceaccount.com)
  6. Set role to Viewer
  7. Click Add

Step 5: Find your GA4 Property ID

  1. Still in GA4 Admin
  2. Click Property Settings
  3. 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.

  1. In Wren, go to Settings › Store Connections › Google Analytics
  2. GA4 Property ID: paste the numeric ID (e.g. 380515265)
  3. Service Account Email: paste client_email from the JSON
  4. Private Key: paste private_key from the JSON — include the full -----BEGIN PRIVATE KEY-----...-----END PRIVATE KEY----- block
  5. Project ID: paste project_id from the JSON
  6. Click Save Connections

Wren will pull the last 7 days of sessions and transactions on the next sync, then keep syncing nightly.