Page cover
For the complete documentation index, see llms.txt. This page is also available as Markdown.

How to Connect GA4

Connecting GA4 allows you to display verified web traffic and user growth directly on your project card. Because GA4 requires secure server-to-server communication, this setup requires generating a specific Service Account key.

Step-by-Step Setup:

  1. Create a Google Cloud Project: Go to your Google Cloud Console and create a new project (or select an existing one tied to your startup).

  2. Enable the API: Search for the Analytics Data API in the Google Cloud library and click "Enable."

  3. Create a Service Account: Navigate to IAM & Admin > Service Accounts. Click "Create Service Account," name it, and generate a new key in JSON format. This file will automatically download to your computer.

  4. Grant Viewer Access: Open the downloaded JSON file and copy the client_email address. Go to your GA4 Dashboard, navigate to Admin > Property Access Management, and add that email address with Viewer permissions.

  5. Locate Your Property ID: In your GA4 Dashboard, go to Admin > Property Settings. Copy your specific Property ID. (Note: Do not use your Account ID).

  6. Connect to Surge: Return to the Surge setup form. Enter your Property ID and upload the JSON key file.

Troubleshooting: "Invalid Credentials" Error: If your GA4 connection fails, it is almost always due to one of three issues:

  • Missing Permissions: The Service Account email address was not successfully added as a "Viewer" in your GA4 property settings.

  • Wrong ID Format: You pasted your GA4 Account ID instead of the Property ID.

  • Corrupted Key: The uploaded JSON file is expired, modified, or incorrect. Generate a fresh key and try again.

Last updated