Google Analytics Connector
Connect your Google Analytics account to let our AI analyze your data and generate charts based on your questions.
Connect Your Google Analytics Account to Our Platform
To let our app analyze your Google Analytics data and create custom reports and charts based on your questions, you need to connect your Google Analytics account. This guide will walk you through the simple steps to set up the connection. Don’t worry if you’re not tech-savvy, we’ve made it as easy as possible with clear instructions. Where helpful, we link to official Google documentation.
What You’ll Need
- A Google account (the one you use for Google Analytics).
- Access to a Google Analytics 4 (GA4) property for your website or app (you can use an existing one or create a new one during this guide).
- Access to a Google Cloud project where you can enable the Google Analytics APIs (you can reuse an existing project or create a new one during this guide).
- About 10–15 minutes to complete the setup.
Step 1: Set Up a Google Analytics 4 Property
If you already have a Google Analytics 4 (GA4) property, skip to Step 2. Otherwise:
- Go to analytics.google.com and sign in with your Google account.
- Click the Admin icon in the bottom-left corner.
- In the Property column, click Create Property.
- Enter a property name, select time zone and currency, then click Next.
- Fill in your business details and click Create.
- Choose Web as the platform, enter your website URL, name the data stream, then Create Stream.
- Note the Measurement ID (e.g., G-XXXXXXXXXX) for later.
For more help, see Google’s official guide on GA4 setup: Set up Analytics for a website and/or app.
Step 2: Create or Choose a Google Cloud Project
If you already have a Google Cloud project you want to use for this integration, you can skip the creation steps below and simply use that existing project. Otherwise, follow these steps to create a new one:
- Open console.cloud.google.com and sign in with the same Google account used for Analytics.
- Click the project dropdown at the top, then New Project.
- Enter a Project Name (e.g., “My Analytics Connection”) and click Create.
- Select your new project from the project dropdown once it’s created.
Step 3: Enable Google Analytics APIs
Enable the Google Analytics Data API in your Google Cloud project:
- Go to APIs & Services → Library in Google Cloud Console.
- Enable Google Analytics Data API.
Step 4: Create a Service Account and Download Credentials
- In Cloud Console, go to APIs & Services → Credentials.
- Click + Create Credentials → Service Account.
- Enter a service account name and optional description. Create and Continue.
- For Role, select Basic → Viewer (read-only). Click Done.
- Open your new service account, go to the Keys tab, then Add Key → Create new key → JSON. Download and keep it safe.
Learn more: Manage service account keys.
Step 5: Grant Access to Your Google Analytics Property
- Open the downloaded JSON file and copy the value of the
client_emailfield. - Go to analytics.google.com → Admin → Property Access Management.
- Click + → Add users, paste the service account email, and assign Viewer role.
Details: Manage GA4 users.
Step 6: Find Your Property ID
In Google Analytics, go to Admin → Property → Property Details. Copy the Property ID (e.g., properties/123456789).
Step 7: Connect to Our Platform
- Log in to our platform.
- Go to Connectors and choose the Google Analytics connector.
- Upload the JSON credentials file from Step 4 and enter your Property ID from Step 6.
- Click Enable. We’ll test the connection and confirm success.
If there’s an error, double-check your JSON file and Property ID, or contact us at yaman@lam-lam.com
Step 8: Start Asking Questions!
Once connected, you can ask questions like:
- “Show me page views for the last 30 days.”
- “What are my top pages by traffic?”
- “How many users visited my site by device type?”
Troubleshooting Tips
- No Data in Reports: Ensure your GA4 property is collecting data (check Realtime in Analytics).
- “Permission Denied”: Verify the service account email is added with Viewer access in Property Access Management.
- “Invalid Credentials”: Ensure you used the correct JSON key and it hasn’t been modified. Re-download if needed.
Security Note
Keep your JSON credentials file safe. Don’t share it publicly or upload it to places like GitHub. Our platform encrypts your credentials to keep them secure.