Learn how to install LiveChat on your site with Google Tag Manager (or GTM) with this step-by-step tutorial.
Install LiveChat using Google Tag Manager
First, log in to your LiveChat account. Then, follow the steps below:
- Go to Settings > Channels > Website, select Install via Google Tag Manager and click on Connect Google Tag Manager.
- You will be redirected to a Google Sign In page. Log in using your e-mail and password. Next, accept livechatinc.com request to access your Google Account.
- Choose GTM account and GTM tag container and click on Install LiveChat.
- 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 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:
- Sign in to your Google account.
- Go to the Google Tag Manager page and click Create Account.
- Choose a name for your account and click Continue.
- 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.
- Read through the GTM Terms of Service and click YES to accept them and continue.
- 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.
- Click OK to close the code snippet box and finish setting up GTM manager and your first container.
Use 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.
Go through those steps to properly configure the integration:
- 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.
- In the next section, click on Tag Configuration.
- Choose the Universal Analytics option.
- Enter your Tracking ID and choose Event from the Track Type drop-down list.
- Hit macro button in the Category section.
- Click on the + button to proceed.
- Press Variable Configuration button.
- Choose Data Layer Variable from the list of available options.
- Type eventCategory in the Data Layer Variable Name field.
- Click on Save button.
- You will be asked to rename your Variable. Use gaLiveChatCategory as the name of Variable and save changes.
- 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.
- 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.
- 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.
- After you’ve set up these variables, click on Triggering button available below.
- Click on the + button available on the next screen.
- On the next screen, click on Trigger Configuration button to set up a new firing rule.
- Choose the Custom Event option.
- Type in LiveChat in the Event name field and click on Save.
- Name the firing rule, e.g. gaLiveChatRule, and click on the Save button.
- 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.