Help and support

Resources that will teach you everything about LiveChat.

Google Tag Manager: add chat to your site

by Krzysztof Kraus

This article will help you with:

Google Tag Manager with LiveChat

Google Tag Manager will allow you to add LiveChat to your website, without the need to edit your website’s source code. It can be used to install tools like conversion tracking, site analytics, remarketing audience and more. Do that with just a few mouse-clicks!

Take a look at how easy it is to add LiveChat tracking code using Google Tag Manager (GTM for short).

Installation

You don’t have to start from scratch. If you are already using GTM, jump straight to the installation part. But if you are new to GTM, follow the steps below to create a new account and your first container.

Creating a Google Tag Manager account and container

Usually, one account is just enough because all tags for all your company’s websites can be managed using a single GTM account. Follow the steps below to create the account:

  1. Sign in to your Google account.
  2. Go to the Google Tag Manager page and click Create Account.
  3. Choose a name for your account and click Continue.
Entering company name
  1. Next, you need to setup a container. The container holds all your tags, such as Google Analytics tag, Adwords tag or LiveChat tag. Name the container, select for Web option and click Create.
Creating a container in Google Tag Manager
  1. Read through the GTM Terms of Service and click YES to accept them and continue.
  2. You will get a container with a code snippet. Copy the code and paste it into every page of your site just below the opening tag.
  3. Click OK to close the code snippet box and finish setting up GTM manager and your first container.

Getting the Google Tag Manager code

Installing LiveChat using Google Tag Manager

There are two main ways to install LiveChat. You can either use the import tool to quickly add both LiveChat and Google Analytics to your existing container, or choose the manual installation.

Quick installation using the import tool

Google Tag Manager lets you import and merge containers to your existing containers uploading a simple file. This way, you can add LiveChat and Google Analytics to your existing container with just one click.

To get the import file, please fill out the form below with your LiveChat login and Google Analytics tracking ID and hit Send me the import file. After a few seconds, you’ll receive the import file to your mailbox along with the installation instructions.

Something went wrong. Make sure you entered a proper Google Analytics Tracking ID and try again.
Check your inbox Check your inbox!

Follow the instructions from the email to install LiveChat and Google Analytics via Google Tag Manager.

Manual installation

  1. From your Google Tag Manager panel, click on New Tag.
Creating a new tag
  1. From the new window, click on Tag Configuration.
Click on Tag Configuration
  1. Choose Custom HTML Tag option.
Click on Custom HTML
  1. Paste LiveChat tracking code inside the HTML container. Click on the Continue button to proceed.
Entering LiveChat code in Google Tag Manager
  1. After adding LiveChat code, click on Triggering button available underneath
Add trigger to your tag
  1. Add a rule that will fire the tag on All Pages.
Add
  1. Click on the Save button in order to add your new Tag.
Saving tag in Google Tag Manager
  1. You will be asked to Rename your Tag – for example, you can use the name of your website. After renaming it, click on Save button.
Renaming your tag
  1. To finalize adding LiveChat to your site, you need to publish your container. Click on Publish button in the top right section of the screen to proceed.
Publishing your tag
  1. Preview the changes that you have made and, if you’re ready, click on the Publish button.
Installing LiveChat on your website

Congratulations! You’ve added LiveChat using Google Tag Manager.

Using Google Tag Manager with Google Analytics

To use the Google Analytics integration with Google Tag Manager, you need to configure a few more things to make sure that various events are recorded correctly.

When using Google Analytics and Google Tag Manager at the same time, make sure to let LiveChat know which code should we track.

Go through those steps to properly configure the integration:

  1. Once you have installed Google Analytics integration, log in to your Google Tag Manager account, go to the Tags section and click on the New button.
Creating a new tag for Google Analytics
  1. In the next section, click on Tag Configuration.
Click on Tag Configuration
  1. Choose the Universal Analytics option.
Choosing the Universal Analytics option
  1. Enter your Tracking ID and choose Event from the Track Type drop-down list.
Entering Google Tag Manager Tracking ID
  1. Hit macro button in the Category section.
Clicking on the Macro Button
  1. Click on the + button to proceed.
Clicking on Plus button
  1. Press Variable Configuration button.
Clicking on Variable Configuration
  1. Choose Data Layer Variable from the list of available options.
Choosing Data Layer Variable
  1. Type eventCategory in the Data Layer Variable Name field.
Typing proper value in the Data Layer Variable field
  1. Click on Save button.
Saving Data Layer Variable
  1. You will be asked to rename your Variable. Use gaLiveChatCategory as the name of Variable and save changes.
Renaming the Variable
  1. In the same way, create a new variable for the Action field. Select Data Layer Variable, enter eventAction as Data Layer Variable Name, click on the Create variable button and name it, e.g. gaLiveChatAction.
  2. Create a new variable for the Label field. Select Data Layer Variable, enter eventLabel as Data Layer Variable Name, click on the Create variable button and name it, e.g. gaLiveChatLabel.
  3. Next, add a new variable for the Value field. Select Data Layer Variable, enter eventValue as Data Layer Variable Name, click on the Create variable button and name it, e.g. gaLiveChatValue.
  4. After you’ve set up these variables, click on Triggering button available below.
Adding a trigger
  1. Click on the + button available on the next screen.
Clicking on a + button
  1. On the next screen, click on Trigger Configuration button to set up a new firing rule.
Clicking on Trigger Configuration
  1. Choose the Custom Event option.
Selecting the Custom Event option
  1. Type in LiveChat in the Event name field and click on Save.
Saving Custom Trigger Rule
  1. Name the firing rule, e.g. gaLiveChatRule, and click on the Save button.
Naming the Firing Rule
  1. Finalize by clicking on the Save button. Again, you will be prompted with a window to rename your new tag, in e.g. LiveChatTag. Confirm changes by clicking on Save.

After you complete the setup, you will be able to use LiveChat with both Google Tag Manager and Google analytics.

Did you find this helpful? Yes No
Thanks for your feedback.
80% of people found this helpful.