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 1 
2→ Click “Connect” on Google Analytics  3
→ Click “Create New Connection”4

🎥 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 MagicBlocks2

Click ‘Create New’ to create a new Goal3

Fill out the Goal Name  (Play Now) and Conversion Value (Play Now)46

Under the "Connect Analytics" section, select the GA account you just linked89

Click Create

This ties your MagicBlocks Goal directly to your GA events dashboard.10

🤖 Step 3: Link the Goal to a Conversation Block

Go to Agents and open one of your Agents12

Choose the Block where your goal should trigger (e.g., a final confirmation message or CTA success)13

Inside the Actions panel:11141516

Select Goal17187

Choose your Google Analytics Goal19

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.21

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.

Was this article helpful?