Install a Chatbot on your website with Google Tag Manager

An alternative to hard-coded JavaScript on your site

Your web chatbot is finished, it’s time to launch it and install it on your site! To do this, you have several choices:

  1. Your site is deployed in WordPress, we have a plugin for this purpose.
  2. Get the JavaScript code delivered by Botnation and embed it in your site. Follow the guide!
  3. A Google Tag Manager is already present on your site? Integrate Botnation’s JavaScript code into your GTM configuration!

This last point is the subject of the article 😉

1. Recovery of the Javascript code

Start by getting the Javascript code to integrate. It is generated via the Botnation platform, you will find more details in the following documentation.

Once the Javascript code is retrieved, you will have to add it on Google Tag Manager to install your Chatbot on your website.

2. Install Google Tag Manager on your website

To start, if you haven’t already done so, install Google Tag Manager on your website. Here is the procedure as described by Google.

3. Creation of the tag

On Google Tag Manager, create a tag of type “Custom HTML” and then add the Javascript code you retrieved earlier.

This code will be inserted into your website to display the Chatbot.

4. Creating a trigger

You will now have to tell Google Tag Manager when to display the Chatbot, this is the role of the trigger.

You will probably need the “Page view” trigger. By default, the Chatbot will display all the pages viewed but you can also filter them as in the example below:

Here, the Chatbot is displayed only if the url contains the keyword botnation.ai. What we want here is to display the Chatbot only on the French version of the site.

5. Publication

All you have to do is save your work and publish your configuration on Google Tag Manager. Once published, changes may take a few minutes to take effect.

6. Example of use

Google Tag Manager can be very useful in the context of a multilingual chatbot. If your site is available in 4 versions, you will create 1 chatbot per language, that is 4 chatbots. All you have to do is distribute the Botnation chatbot via Google Tag Manager by positioning triggers only on the targeted languages based on your addresses including /en/ or /fr/. So you can easily get a different chatbot tag for each language.

Plus:
How to publish my web chatbot?
How do I publish my chatbot on my WordPress site?

Create your Chatbot Easily and for Free!