## Deploy chatbot using the GTM integration
This document provides instructions for deploying a web bot on your website, if it is integrated with Google Tag Manager (GTM).
## Setup chatbot on the website using GTM integration
To set up a chatbot using GTM integration, follow the steps outlined below:
## Create a Tag
To create a Tag, follow these steps:
1. Login to your [Google Tag Messenger](https://tagmanager.google.com/) and create an account.
2. Navigate to [Google Tag Messenger](https://tagmanager.google.com/) account and select the container you want to configure.

3. Click **Tags** > **New**.

4. Choose the **Custom HTML** tag type.

5. Copy the below script and paste it under the **Custom HTML** tag.
```js
<script>
window.ymConfig = { bot: "bot id", host: "https://r1.cloud.yellow.ai" };
function botScript() {
var w = window,
ic = w.YellowMessenger;
if ("function" === typeof ic){
ic("reattach_activator");
ic("update", ymConfig);
}
else {
var d = document,
i = function () {
i.c(arguments);
};
i.q = [];
i.c = function (e) {
i.q.push(e);
};
w.YellowMessenger = i;
if(w.attachEvent) {
w.attachEvent("onload", l)
}
else {
window.addEventListener('load', l);
w.addEventListener("load", l, !1)
}
}
function l() {
var e = d.createElement("script");
e.type = "text/javascript";
e.async = !0;
e.src = "https://cdn.yellowmessenger.com/plugin/widget-v2/latest/dist/main.min.js";
var t = d.getElementsByTagName("script")[0];
t.parentNode.insertBefore(e, t);
}
}
botScript();
</script>
```
:::note
In the above script, you need to update the "Bot ID" and appended regions - r0/r1/r2/r3/r4/r5.
:::
| Region Code | Region | Host |
| --- | --- | --- |
| R0 | INDIA - India | https://cloud.yellow.ai |
| R1 | MEA - UAE North | https://r1.cloud.yellow.ai |
| R2 | JAKARTA | https://r2.cloud.yellow.ai |
| R3 | SINGAPORE | https://r3.cloud.yellow.ai |
| R4 | USA | https://r4.cloud.yellow.ai |
| R5 | EUROPE | https://r5.cloud.yellow.ai |

6. Click **Save** to change the configuration changes.
## Create a Trigger
To control when the chatbot loads on your website, you need to define when to load the bot on your website with a trigger.
To create a Trigger, follow these steps:
1. Click **Trigger** > **New**.

2. Choose the trigger type as **Page view**.

3. In the Page view section, select **Some page views**.

4. In the *Trigger configuration*, under "Page view," perform the following:
i. In *This trigger fires on*, select **Some Page Views**.

ii. In *Fire this event when an event occurs and all of these conditions are true* section, select **Page URL** and **Contains** from the drop-down and enter the URL of your website page.
* Click **Save**.

A reference to your trigger associated with the tag will be displayed.

5. On top of the menu bar, click **Preview**.

6. Enter your website URL and click **Connect**.

7. Enter the URL of your site to connect your chatbot, and click **Connect**.
This will redirect to your website, and the Tag Assistant will be connected. Open the chatbot to start the conversation.
