---
title: "Install with Google Tag Manager"
url: "https://help.magicblocks.ai/en/article/embed-your-ai-agent-with-google-tag-manager"
language: "en"
last_updated: "2026-03-18T08:20:51.245Z"
---

# Install with Google Tag Manager

Ready to deploy your MagicBlocks AI Agent across your entire website using Google Tag Manager? GTM is a powerful, centralized way to manage scripts, perfect for teams, marketers, and multi-site installs.

## **What You’ll Need Before You Start**

Before we jump in, make sure you have everything ready:

-   A **published** AI Agent built in MagicBlocks
-   Your **MagicBlocks Embed Code** (here’s the step-by-step on how to get the code ([Embedding](https://help.magicblocks.ai/en/article/embedding-your-ai-agent-to-a-website)).
-   Access to your **Google Tag Manager account**

## **Step-by-Step: How to Embed Your AI Agent with Google Tag Manager**

### **1\. Copy the Embed Code from MagicBlocks**

Start in your MagicBlocks dashboard:

1.  Go to **Agents**
2.  Select the Agent you want to go live with
3.  Navigate to the **Go Live**
4.  **Copy** the code to Embed.![1](https://export.supademo.com/renders/su564pgu4n/out.png)

This is the script you’ll paste into Google Tag Manager to activate the Agent on your site.

This video will explain the step-by-step process on how to embed your AI Agent with Google Tag Manager:

### **2\. Open Your Google Tag Manager Dashboard**

Log in to [Google Tag Manager](https://tagmanager.google.com/), then:

### Select the **container** associated with your website![2](https://export.supademo.com/renders/bqg764zr3o/out.png)  
**3\. Click “Add a New Tag”**

### In the GTM workspace, click the button labeled **“Add a new tag”**.![3](https://export.supademo.com/renders/l3pj3lhqwz/out.png)  
**4\. Edit the Tag Configuration**

In the new tag setup window:

Click the **pencil icon** inside the “Tag Configuration” box to open tag options![4](https://export.supademo.com/renders/3wigz9dxyu/out.png)

### **5\. Select “Custom HTML” as the Tag Type**

### From the list of tag types, choose **Custom HTML**.![5](https://export.supademo.com/renders/un9bo5ssqu/out.png)  
**6\. Paste the MagicBlocks Embed Code**

In the HTML editor:

Paste the MagicBlocks embed code you copied earlier

### This code will inject your AI Agent across your site.![6](https://export.supademo.com/renders/r5zv62t2kx/out.png)  
**7\. Configure the Trigger**

### Click the **pencil icon** next to the “Triggering” section.![7](https://export.supademo.com/renders/6e13lk3f8l/out.png)  
**8\. Choose “All Pages” as the Trigger**

### From the trigger list, select **“All Pages”**. This tells GTM to fire the MagicBlocks script across your entire site.![8](https://export.supademo.com/renders/590gzw899j/out.png)  
**9\. Rename the Tag**

### At the top of the tag window, click **“Untitled Tag”** and rename it to something clear like: MagicBlocks Tag![9](https://export.supademo.com/renders/j61sczr31q/out.png)  
**10\. Click “Save” and Publish**

Click **Save** to finalize the tag

## Then hit **“Submit”** in the top-right to publish the changes to your site![10](https://export.supademo.com/renders/vb0i8rvgw9/out.png)  
Your AI Agent is Now Live! 🎉

Your MagicBlocks Agent will now appear across your website wherever the Google Tag Manager container is installed.

## Start Chatting & Testing

1.  Visit your website
2.  Confirm the MagicBlocks chat icon appears (bottom right or sidebar, depending on your settings)
3.  Start a test conversation and verify your contact capture, qualification flow, or calendar booking setup

  
⚠️ If the AI Agent is not visible:

It may be blocked by an **ad-blocker**. Try disabling browser extensions or testing in an incognito window.
