Skip to content

Google Analytics

This guide will walk you through connecting your Google Analytics 4 (GA4) property to Chartivo to enable web analytics, user behavior insights, and traffic metrics tracking.

Before you begin, ensure you have:

  • An active Google Analytics 4 property
  • A Google Cloud Platform (GCP) project
  • Administrator access to your Google Analytics property

Note: If you already set up Google Search Console integration, you can reuse the same GCP project and service account. Skip to Step 7 if you want to use an existing service account.


  1. Open your browser and navigate to https://console.cloud.google.com
  2. Log in with your Google account (use the same account that has access to your GA4 property)
  3. If you don’t have a GCP project yet, create one by clicking Select a project → New Project

  1. In the project selector dropdown, either:
  • Select an existing project that you want to use for this integration, OR

  • Click New Project to create a new one

    Google Cloud Console project selector dropdown showing "New Project" option

  1. If creating a new project:
    • Enter a project name (e.g., “Chartivo Analytics Integration”)
    • Click Create
    • Wait for the project to be created (usually takes 10-30 seconds) Google Cloud New Project dialog with project name field and Create button

  1. In the Google Cloud Console, open the navigation menu (☰ hamburger icon)

  2. Navigate to APIs & ServicesLibrary

    Google Cloud Console navigation menu with APIs & Services and Library highlighted

  3. In the API Library search bar, type: Google Analytics Data API

  4. Click on Google Analytics Data API from the search results

    Google Cloud API Library search results showing Google Analytics Data API

  5. Click the Enable button

    Google Analytics Data API page with blue Enable button


  1. In the navigation menu, go to APIs & ServicesCredentials Google Cloud navigation menu showing "Credentials" button

  2. Click + Create Credentials at the top

  3. Select Service Account from the dropdown menu

    Create Credentials dropdown menu with Service Account option highlighted

  4. Fill in the service account details:

    • Service account name: chartivo-analytics (or your preferred name)
    • Service account ID: Will auto-populate based on the name
    • Description: Service account for Chartivo GA4 integration (optional)
  5. Click Create and Continue

    Service account creation form with name chartivo-analytics and auto-populated ID

Tip: If you already created a service account for Google Search Console, you can reuse it. Skip to Step 7 and use the existing service account email.


Step 5: Grant Service Account Permissions (Optional)

Section titled “Step 5: Grant Service Account Permissions (Optional)”
  1. On the Grant this service account access to project screen:
    • You can skip this step by clicking Continue (no project-level roles are required)
  2. On the Grant users access to this service account screen:
    • You can skip this step by clicking Done

      Service account permissions screen with "Done" button to finish the steps


Step 6: Create and Download Service Account Key

Section titled “Step 6: Create and Download Service Account Key”
  1. You’ll be returned to the Credentials page

  2. Under Service Accounts, find the service account you just created

  3. Click on the service account email address to open its details

    Google Cloud Credentials page showing the newly created service account in the list

  4. Navigate to the Keys tab

  5. Click Add KeyCreate new key

    Service account details page with Keys tab selected and Add Key dropdown menu

  6. Select JSON as the key type

  7. Click Create

  8. The JSON key file will automatically download to your computer

    Create private key dialog with JSON key type selected

  9. Important: Save this file securely - you’ll need it for Chartivo configuration

    Example for the service account JSON key file that got downloaded

⚠️ Security Warning: This JSON file contains private credentials. Never commit it to version control or share it publicly.


  1. Open a new browser tab and navigate to https://analytics.google.com

  2. Select your GA4 property from the property selector (top left)

  3. Click on Admin (gear icon) in the bottom left sidebar

    Google Analytics 4 interface with Admin gear icon highlighted in bottom left navigation

  4. In the Property column (middle column), click Property then Property details under Property settings

  5. Your Property ID will be displayed near the top of the page

    • Format: A numeric value like 123456789
  6. Copy this Property ID (you’ll need it for Chartivo)

    Google Analytics 4 Property details page showing the Property ID numeric value


Step 8: Grant Service Account Access to GA4

Section titled “Step 8: Grant Service Account Access to GA4”

Now you need to give your service account permission to read data from your GA4 property.

  1. Still in the Admin section, ensure you’re viewing the correct property

  2. In the Property column, click Property Access Management

  3. Click the + (plus) button in the top right to add a user

    Google Analytics Property Access Management page with Add users button highlighted

  4. In the email address field, paste your service account email address

    • This is found in the JSON file you downloaded (look for "client_email")
    • Format: chartivo-analytics@your-project.iam.gserviceaccount.com
  5. Under Role, select Viewer (this gives read-only access)

  6. Uncheck Notify new users by email (service accounts don’t receive emails)

  7. Click Add

    Add users dialog with service account email, Viewer role selected, and email notification unchecked Property Access Management showing the service account successfully added with Viewer role


  1. Log in to your Chartivo account

  2. Navigate to the Integrations page from your dashboard

    Chartivo dashboard with Integrations menu item in the navigation

  3. Locate the Google Analytics 4 Configuration card

    Chartivo Integrations page showing Google Analytics Configuration card


  1. In the Google Analytics 4 Configuration section, find the GA4 Property ID field
  2. Paste the Property ID you copied from Step 7
    • Enter only the numeric value (e.g., 123456789)

Step 11: Upload Service Account Credentials

Section titled “Step 11: Upload Service Account Credentials”
  1. Click the Choose File button under Service Account Credentials (JSON)
  2. Navigate to where you saved the JSON key file from Step 6
  3. Select the JSON file (filename format: your-project-xxxxx.json)
  4. The filename should appear next to the button after selection

  1. Review your entered information:
    • Property ID is correct
    • JSON credentials file is selected
  2. Click the Save button at the bottom of the form
  3. Wait for the save operation to complete (usually 2-5 seconds)

Chartivo Google Analytics configuration form with Property ID and JSON file filled in, ready to save


After saving, you should see a success message displayed as a green banner. The message will confirm: “Google Analytics integration created successfully” (for new integrations) or “Google Analytics integration updated successfully” (for updates). If you already had a configuration, you’ll also see a green checkmark (✓) indicating “Credentials already configured” below the file upload field.

Green success banner showing Google Analytics integration created successfully


  1. Navigate to the Homepage

  2. Click New Chart

    Chartivo homepage with New Chart button highlighted

  3. Select Google Analytics as your data source

  4. You should now see available GA4 metrics such as:

    • Sessions
    • Total Users
    • New Users
    • Bounce Rate
    • Average Session Duration
    • And more…
  5. Select a metric and date range to verify data is loading correctly

    Chartivo chart creation interface with Google Analytics selected as data source showing available metrics


  • Ensure you entered the Property ID in the first field
  • Verify the Property ID contains only numbers (no letters or “properties/” prefix)

Error: “Service account credentials file is required for new integration”

Section titled “Error: “Service account credentials file is required for new integration””
  • Make sure you selected the JSON file using the file picker
  • Verify the file is actually a .json file (not .txt or other format)
  • Re-download the key file from Google Cloud Console if needed

Error: “Failed to save Google Analytics integration”

Section titled “Error: “Failed to save Google Analytics integration””
  • Check that the JSON file is valid (open it in a text editor - it should contain client_email, private_key, etc.)
  • Verify your service account has been granted Viewer access to the GA4 property (Step 8)
  • Ensure the Google Analytics Data API is enabled in your GCP project (Step 3)
  • Wait 24-48 hours after setting up GA4 for the first time (initial data collection period)
  • Verify your GA4 property is collecting data (check in Google Analytics directly)
  • Confirm the Property ID matches exactly
  • Check that the service account has Viewer role on the property
  • Ensure your selected date range contains data

Error: “Access denied” or “Permission denied”

Section titled “Error: “Access denied” or “Permission denied””
  • Double-check that you completed Step 8 (granting service account access)
  • Verify the service account email in the JSON file matches what you added in GA4
  • Ensure you selected Viewer role (not just “No role”)
  • Wait a few minutes for permissions to propagate after adding the service account

If you need to change your Property ID or update credentials:

  1. Return to the Integrations page in Chartivo
  2. Modify the GA4 Property ID field (if needed)
  3. Upload a new credentials file (if needed) - this is optional if updating only the Property ID
  4. Click Save
  5. You’ll see a confirmation: “Google Analytics integration updated successfully”

Chartivo encrypts your service account credentials JSON before storing it in our database. Your credentials are only decrypted when making authorized API calls to Google Analytics on your behalf. We never expose your unencrypted credentials in logs, user interfaces, or error messages.

The service account follows the principle of least privilege - it only has read-only (Viewer) access to your GA4 data and cannot modify your analytics configuration or data.


A service account is a special type of Google account that represents an application (like Chartivo) rather than a person. It allows Chartivo to access your Google Analytics data programmatically without requiring you to share your personal Google credentials.

The JSON file contains cryptographic keys that prove Chartivo’s identity to Google. This is more secure than using passwords and can be easily revoked if needed.

If you ever need to revoke Chartivo’s access to your GA4 data:

  1. Go to Google Analytics → Admin → Property Access Management

  2. Find the service account email

  3. Click the three dots (⋮) and select “Remove access”

    Google Analytics Property Access Management showing how to remove service account access with three-dot menu


If you encounter any issues during setup:

  • Check that all steps were completed in order
  • Review the troubleshooting section above
  • Contact Chartivo support with details about which step failed

Appendix: Finding Your Service Account Email

Section titled “Appendix: Finding Your Service Account Email”

If you need to find your service account email address after downloading the JSON:

Option 1: From the JSON file

  1. Open the downloaded JSON file in a text editor
  2. Look for the "client_email" field
  3. The value will be in the format: service-account-name@project-id.iam.gserviceaccount.com

Option 2: From Google Cloud Console

  1. Go to APIs & Services → Credentials
  2. Under Service Accounts, you’ll see the email address listed

Chartivo requires the following Google Analytics permissions:

  • Read access to GA4 property data
  • Read access to user metrics
  • Read access to event data
  • Read access to conversion data

We never request write permissions to your Google Analytics account.


Q: How far back does the integration sync data?

A: We sync up to 1 month of historical data from your Stripe account.

Q: Can I connect multiple Stripe accounts?

A: No. We don’t support connecting multiple Stripe accounts currently.

Q: Does this work with Universal Analytics (UA)?

A: No, this integration is specifically for Google Analytics 4 (GA4). Universal Analytics was sunset in July 2023.

Q: Can I use the same service account for multiple Chartivo organizations?

A: Yes, but we recommend creating separate service accounts for better access control and easier revocation if needed.