Pricing
Go to app
User Name
E-mail
Upgrade Help Center

Google Tag Manager: add LiveChat to your sites

Krzysztof Kraus
6 min read
updated: Oct 4, 2023

Learn how to install LiveChat on your site with Google Tag Manager (or GTM) with this step-by-step tutorial.

Install LiveChat on existing Google Tag Manager accountLink icon

First, log in to your LiveChat account. Then, follow the steps below:

  1. Go to Settings > Channels > Website, select Install via Google Tag Manager and Connect Google Tag Manager.
  2. You will be redirected to a Google Sign In page. Log in using your e-mail and password. Accept livechatinc.com request to access your Google Account.
  3. Choose GTM account and GTM tag container and select Install LiveChat.
  4. Finally, you should see “Congratulations! LiveChat on your website is now up and running!” message.

That’s it! You’ve added LiveChat using Google Tag Manager.

Create a Google Tag Manager account and install LiveChat manuallyLink icon

The following steps will guide you on how to create your GTM account, tag and add LiveChat installation code manually:

1
Sign in to your Google account.
2
Go to the Google Tag Manager page and select Create Account.
3
Choose a name for your account.
4
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 Web and confirm with Create.
5
Read through the GTM Terms of Service and select YES to accept them.
6
A container with a code snippet will pop up. Copy the code and paste it into every page of your site just below the opening tag.
7
Select OK to close the code snippet box and finish setting up your first container.
8
Select Add a new tag to create a tag in your container.
9
Select Tag Configuration and choose Custom HTML.
10
Copy LiveChat installation code and paste it into the HTML tab.
11
Proceed to Triggering and select All Pages.
12
Save the configuration. GTM will ask you to name your tag. Enter the name and save it to finish LiveChat installation.

Integrate Google Tag Manager with Google AnalyticsLink icon

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.
When using Google Analytics and Google Tag Manager at the same time, make sure to let LiveChat know which code should we track.

Once you have installed Google Analytics integration, log in to your Google Tag Manager account, and select the New Tag button to start configuring your new Google Analytics tag.

New Tag

Set up a triggerLink icon

1
Select Triggering button available below.
2
On the next screen select the + button.
3
Next, select Trigger Configuration to set up a new firing rule.
4
Choose the Custom Event option.
5
Type LiveChat in the Event name field and select Save.
6
Name the firing rule, e.g. gaLiveChatRule, and select Save button.

You’ve successfully set the trigger! You can proceed to the next steps to configure your tag.

Set up a tagLink icon

1
Start by selecting Tag Configuration.
2
After this step you can decide which Google Analytics tracking version you want to use. Below you can find steps for Google Analytics versions 3 and 4.

Google Analytics version 3Link icon

1
Choose the Universal Analytics option.
2
Expand the Google Analytics Settings dropdown and select New Variable.
3
Enter your Google Analytics Tracking ID and save it.
4
Enter the variable name, for example Google Analytics Tracking ID and save it.
5
Expand the Track Type dropdown and select Event.
6
Hit macro button in the Category section.
7
Click on the + button to proceed.
8
Press Variable Configuration.
9
Choose Data Layer Variable from the list of available options.
10
Type eventCategory in the Data Layer Variable Name field and save.
11
You will be asked to rename your Variable. Enter gaLiveChatCategory as the name of Variable and save changes.
  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.

Google Analytics version 4Link icon

1
Select the Google Analytics: GA4 Event option.
2
Expand the Select Configuration tag dropdown and choose the New tag….
3
Enter the Google Analytics 4 tracking ID and save it:
4
Enter the variable name, for example Google Analytics 4 Tracking ID and save it.
5
Select the macro button in the Event Name section.
6
Select the + button to proceed.
7
Press Variable Configuration.
8
Choose Data Layer Variable from the list of available options.
9
Type eventCategory in the Data Layer Variable Name field and save.
10
You will be asked to rename your Variable. Use gaLiveChatCategory as the name of Variable and save changes.
11
Expand the Event Parameters tab and select the Add Row button.
12
Type eventAction in the Parameter Name field and Select the macro button in the Value section.
13
Select the + button to proceed.
14
Press Variable Configuration.
15
Choose Data Layer Variable from the list of available options.
16
Type eventAction in the Data Layer Variable Name field and save.
17
You will be asked to rename your Variable. Use gaLiveChatAction as the name of Variable and save changes.
18
In the same way create a new row and 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.
19
Next, add a new row and 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.
20
Save your tag configuration.
21
Publish changes in the GTM panel.

Complete your GA4 setup by following this guide.

That’s it! From now on, the LiveChat widget events will show up in your Google Analytics report!

  1. To begin, log into your Google Tag Manager account.
  1. Go to Tags and click on New.

Add new tag in Google Tag manager

  1. Select the LiveChat tag from the Tag Configuration section.

LiveChat tag in Google Tag Manager

  1. To complete this step, make sure that you have an active LiveChat account as you need it to get your license ID.

  2. Log in to your LiveChat account and go to Settings > Chat widget > Channels.

  3. In the code section, you can easily find your License ID (an 8-digit number). Copy this number so that you can use it later in Google Tag Manager.

LiveChat license id

  1. Paste in your LiveChat license number, and click Save.

Was this article helpful?

Got it!

Thanks for your feedback.

Thank you!

We’re happy to help.

RELATED ARTICLES

Segment: live chat in your store or app

How to turn on LiveChat - Segment integration? Read more to learn how to integrate LiveChat with Segment!

Read the article

WHMCS: placing LiveChat on your site

How to add live chat software to WHMCS page in a few minutes and start chatting with clients? It's easy with live chat for WHMCS integration.

Read the article

Start using LiveChat now!

Free 14-day trial Team plan features No credit card required

Still not convinced? Discover all LiveChat features

Discover text| products: