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
Login to your Google Tag Messenger and create an account.
Navigate to Google Tag Messenger account and select the container you want to configure.
Click Tags > New.
Choose the Custom HTML tag type.
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>
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 |
- 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:
Click Trigger > New.
Choose the trigger type as Page view.
In the Page view section, select Some page views.
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.
On top of the menu bar, click Preview.
Enter your website URL and click Connect.
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.