First, please make sure that you have configured the domains for your websites. To integrate your chatbot with Google Tag Manager, you will need the code to be found in →
under "Website" → "Website Integration".
Copy the API key from your code. The API key does not correspond to the whole block of code that you can copy, it is only the part marked in bold:
<script type="text/javascript" src="https://chat.aiaibot.com/bootstrap.js"
data-aiaibot-key="e146a111-68a7-4814-9a25-d242243e47b1" defer>
</script>
Paste the API key into the following placeholder named API_KEY and copy the section into your Tag Manager:
<script>
var script = document.createElement("script");
script.setAttribute('defer', 'true');
script.setAttribute('data-aiaibot-key', 'API_KEY');
script.src = "https://chat.aiaibot.com/bootstrap.js";
document.getElementsByTagName("body")[0].appendChild(script);
</script>