Google Tag Manager

Integrate web Instabot using Google Tag Manager

📘

Don't have an Instabot account yet?

Start your free trial today!

Overview

This guide will demonstrate how to integrate web Instabot into your site using Google Tag Manager.


Contents

  1. Prepare the Instabot JavaScript code
  2. Insert Instabot into your page

🚧

Prerequisites

  1. Instabot portal account is created

  2. Instabot conversation is created


1. Prepare the Instabot JavaScript code

  1. In the JavaScript below, replace the following value with your API key:
<script type = "text/javascript" > (function(i, s, o, u, a, m) {
    a = s.createElement(o);
    a.innerHTML = 'apiKey: "/8MRPdIyb3v35RuvyoQ266b5TnBKej6NvYm53Dg795Q="';
    tags = s.getElementsByTagName(o);
    m = tags[tags.length - 1];
    a.async = 1;
    a.crossorigin = "anonymous";
    a.src = u;
    m ? m.parentNode.insertBefore(a, m) : s.body.appendChild(a);
})(window, document, "script", "https://widget.instabot.io/jsapi/rokoInstabot.js"); </script>

That's it! Now we're ready to insert our Instabot JavaScript into our page via Google Tag Manager.


2. Insert Instabot into your site using Google Tag Manager

📘

IMPORTANT

You only have to perform these steps once! Once the Instabot code is inserted into your website, you can change your Instabot's location, behavior, and content in the portal without touching any code, ever again!

  1. In Google Tag Manager, click "Add a new tag".
1425

Add a new tag

  1. Under "Tag Configuration", select "Custom HTML"
1431

Custom HTML tag

  1. Insert the Instabot JavaScript, then add a Google Tag Manager trigger
1427

Insert the Instabot JavaScript

  1. Select "all pages" (or whatever is appropriate) for the GTM trigger, then click Save
1430

Save GTM trigger

  1. Click Submit to insert your tag into your page.
1437

Insert tag via GTM into page

  1. Finally. click Publish
1427

Publish