Chat with your Google Analytics data
Pull GA4 data directly into your AI workspace and analyze traffic, conversions, and user behavior without switching platforms.
Step 1. Set up your n8n integration in Team-GPT
Before you can connect Google Analytics data, you need to set up n8n integration in your Team-GPT workspace. This creates the bridge between your AI agents and external tools like GA4.
Prerequisites:
- An n8n instance running (self-hosted or n8n Cloud)
- Admin access to your n8n instance
- A Team-GPT project for the integration
Quick setup overview:
- Generate an n8n API key - Go to your n8n instance settings, create an API key, and save it securely
- Connect n8n to Team-GPT - In your Team-GPT Project Knowledge panel, click "Connect n8n" and enter your instance URL and API key
- Create your GA4 workflow in n8n - Build a workflow that starts with a Manual Trigger node and includes the MCP server connection to Google Analytics
- Attach the workflow to your project - In Team-GPT's Project Knowledge panel, select your GA4 workflow from the list of available workflows
Once connected, your AI agents can trigger the workflow during conversations and pull GA4 data automatically.
Need detailed instructions? Follow the complete N8N in Team-GPT Setup Guide for step-by-step screenshots and workflow examples.
Step 2. Create the Google Analytics workflow in your n8n instance
Now you need to create the actual workflow that connects to Google Analytics 4 and retrieves your data.
This workflow includes:
- A Manual Trigger node (required for Team-GPT to execute the workflow)
- An AI agent with memory for conversation context
- MCP client and server configuration
- Connection to GA4 for data retrieval
- Additional tools like Think Tool and Calculator (optional)
To set up the workflow:
- Get the workflow from here - [Google Analytics in Team-GPT with n8n]
- Import into n8n - In your n8n instance, click the menu and select "Import from File" or directly paste from clipboard
- Configure GA4 credentials - Add your Google Analytics 4 authentication credentials in the MCP server settings
- Test the workflow - Click "Execute Workflow" to make sure it connects to GA4 successfully
The workflow will handle all communication between Team-GPT and Google Analytics, processing your data requests and returning formatted results.
Step 3. Set up your project knowledge and add the workflow
Navigate to your Project in Team-GPT (this could be for your marketing team, analytics workspace, or a specific client). Click the "Project knowledge" button to open the panel on the right side.
Add your essential context:
- Detailed agent instructions (core identity, voice, tone, brand preferences)
- Target audience information and demographics
- Competitor research and market analysis
- Website URL and key pages to track
- Important conversion goals and KPIs
- Traffic source definitions (which channels matter most to your business)
- Reporting preferences (weekly, monthly, specific metrics you track regularly)
- Any existing analytics reports or dashboards you reference
Document used in this example: Google Analytics Documentation.pdf
Add the n8n workflow:
- In the Project Knowledge panel, find the "Automations" section
- Click the add button and browse all your n8n workflows
- Select your Google Analytics workflow from the list (remember they should start with Manual Trigger node)
- Click "Select" to add it to your project
This context gets referenced automatically in every chat within the project, so you only need to set it up once. Whenever an n8n workflow is executed in the current chat, the results get stored so you can continue referencing them. If you start a new chat, you'll have to pull the data again to work with it.
The more comprehensive your context, the better your AI-generated campaigns will be – the AI takes into account all the information you include and gives you much better responses.
Step 4. Chat with your GA4 data
Begin with a prompt like: "I want to get traffic information for the last 30 days compared to the previous 30 days by session source medium. The property ID is [your-property-id]."
Team-GPT will automatically trigger the n8n workflow, query GA4, and return your data in the chat. You'll see metrics like sessions, active users, new users, engagement rates, and conversions.
Continue the conversation:
- "Show me all channels, not just the top one"
- "Format this data in a readable table"
- "Which channels have the best conversion rates?"
- "Compare organic search performance to last month"
The AI maintains context from your previous data pulls, so you can analyze your analytics through natural conversation without switching to Google Analytics.
Extra Tips
- Save your GA4 property ID in Project Knowledge: Add it once as a text file so you don't need to provide it with every request—AI agents will reference it automatically
- Be specific with date ranges: Instead of "recent data," specify exact periods like "last 30 days vs previous 30 days" for clearer comparisons
- Request multiple metrics at once: Ask for sessions, conversions, and engagement in a single prompt to get a complete picture faster
- Format data immediately: Add "and format as a table" to your initial request to skip the extra formatting step
- Add reporting preferences to your instructions: Tell AI agents which metrics matter most to your business so they prioritize the right data in their analysis
- Keep data in the same chat: Workflow results are stored in your current conversation, so you can continue referencing them. If you start a new chat, you'll need to pull the data again
- Create reusable prompts: Build and save your most frequent GA4 queries in your project so your team can run them with one click
- Combine with other context: Add competitor data, campaign calendars, or ad spend information to Project Knowledge so AI can provide deeper insights when analyzing your GA4 metrics
- Set up multiple workflows for different needs: Create separate n8n workflows for traffic analysis, conversion tracking, and content performance to keep queries organized
This playbook is created by Simeon Penev, Data & Analytics Consultant at VertoDigital
.webp)
.png)
.webp)

.webp)