Track goals in Google Analytics
Want to know exactly how your AI Agent is performing?
With just a few clicks, you can connect Google Analytics (GA) to MagicBlocks and start tracking real-time goal completions all inside your GA dashboard.
This tutorial walks you through the full setup so you can start measuring what matters.
✅ Step 1: Connect Google Analytics to MagicBlocks
To get started, go to:
Library > Connections
→ Click “Connect” on Google Analytics
→ Click “Create New Connection”
🎥 Check the first few steps to connect Google Analytics to Magicblocks:
You'll be prompted to enter:
Google Analytics Name
Measurement ID – Found in your Google Analytics > Admin > Data Streams > Web Stream Details
API Secret – Found under Measurement Protocol API Secrets in Google Analytics
🎥 This is how you will find Measurement ID and API Secret on Google Analytics:
Fill them out and click ‘Create’. Once connected, this integration will be available whenever you set a goal.
🎯 Step 2: Assign Google Analytics to a MagicBlocks Goal
Navigate to Library > Goals in MagicBlocks
Click ‘Create New’ to create a new Goal
Fill out the Goal Name (Play Now) and Conversion Value (Play Now)
Under the "Connect Analytics" section, select the GA account you just linked
Click Create
This ties your MagicBlocks Goal directly to your GA events dashboard.
🤖 Step 3: Link the Goal to a Conversation Block
Go to Agents and open one of your Agents
Choose the Block where your goal should trigger (e.g., a final confirmation message or CTA success)
Inside the Actions panel:
Select Goal
Choose your Google Analytics Goal
Save or Publish the Agent
After linking the Goal to the Block, you need to save or publish the Agent to ensure all changes are applied.
Test the Agent
Interact with the Agent to trigger the Goal. Once the Goal is completed, MagicBlocks will send the event goal_completed to the connected Google Analytics account.
Check in Google Analytics
After the Goal is completed in the Agent, go to your Google Analytics account to verify that the event is being tracked.
Now, every time this goal is reached, MagicBlocks will fire the connected GA event.
📈 Step 4: Google Analytics Event Tracking When the goal is completed
When a goal is completed by the AI Agent, the goal_completed event is automatically triggered and sent to Google Analytics. in 24 hours.
Viewing the Event in Google Analytics
To view the goal_completed event data:
Go to Google Analytics 4 > Reports > Engagement > Events.
Search for or filter by the event name "goal_completed".
Track the count, user activity, and time of each conversion.
By connecting MagicBlocks to Google Analytics, you get full visibility into your goal completion metrics, providing data-backed insights into your AI's performance.
The event will have delayed time as we checked within 24 hours.