Skip to main content

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

  1. Login to your Google Tag Messenger and create an account.

  2. Navigate to Google Tag Messenger 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.

<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 CodeRegionHost
R0INDIA - Indiahttps://cloud.yellow.ai
R1MEA - UAE Northhttps://r1.cloud.yellow.ai
R2JAKARTAhttps://r2.cloud.yellow.ai
R3SINGAPOREhttps://r3.cloud.yellow.ai
R4USAhttps://r4.cloud.yellow.ai
R5EUROPEhttps://r5.cloud.yellow.ai

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