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).
  • 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

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, then:

Select the container associated with your website2
3. Click “Add a New Tag”

In the GTM workspace, click the button labeled “Add a new tag”.3
4. Edit the Tag Configuration

In the new tag setup window:

Click the pencil icon inside the “Tag Configuration” box to open tag options4

5. Select “Custom HTML” as the Tag Type

From the list of tag types, choose Custom HTML.5
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
7. Configure the Trigger

Click the pencil icon next to the “Triggering” section.7
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
9. Rename the Tag

At the top of the tag window, click “Untitled Tag” and rename it to something clear like: MagicBlocks Tag9
10. Click “Save” and Publish

Click Save to finalize the tag

Then hit “Submit” in the top-right to publish the changes to your site10
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 lead 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.

Was this article helpful?