Connect Google Tag Manager
Use Google Tag Manager(opens in new tab) to manage your website tags without editing code. Infobip Live Chat supports this tag management solution.
If you already use Google Tag Manager on your web pages for other purposes, use it for Live Chat with zero downtime.
Prerequisites [#prerequisites]
You need a Google Tag Manager account and the Google Tag Manager installation on your website. If you do not have one, set it up:
- Create a Google Tag Manager account(opens in new tab).
- Log in to your Google account or create one.
- Go to Google Tag Manager(opens in new tab).
- Select Create account on the right side.
- Enter the name of your account, country, container name, and platform.
- Select Create to confirm the configuration.
- Read and accept the Google Tag Manager Terms of Service Agreement(opens in new tab).
- Install Google Tag Manager on your website by following the instructions in Google Tag Manager. For more information, see the GTM Quickstart documentation(opens in new tab).
After you install Google Tag Manager, connect it to Live Chat.
Load the widget through Google Tag Manager [#load-the-widget-through-google-tag-manager]
Load the Live Chat widget through Google Tag Manager instead of adding the snippet to your website code. To add the snippet directly, see Install the web widget.
To load the Live Chat widget through Google Tag Manager:
- Log in to the Infobip web interface and go to Channels and Numbers → Channels → Live Chat. Select your widget or select Create widget.
- Expand Installation and security.
- In Install Live Chat on your website, select the Google Tag Manager tab. To copy the snippet code, select the copy icon in the top right corner of the code box.
- Select Open GTM below the snippet code and log in to Google Tag Manager with your Google account.
- Under Tags, select New in the top right corner to add a tag.
- Select the Tag Configuration panel and select the Custom HTML tag type.
- Paste the snippet code from step 3 in the HTML text box.
- Configure the tag firing(opens in new tab) to run when you want on your website.
- Configure the triggering.
- Save the tag.
- Publish the tag. Select Publish and Create Version to push the changes to your sites.
Share events with Google Analytics [#share-events-with-google-analytics]
Use the Live Chat channel to share events with your Google Analytics account. Then track these events in Google Analytics through Google Tag Manager.
The widget pushes every event to the Google Tag Manager data layer as one liveChatInteraction event. The action field shows which action happened. For example, when the end user opens the widget, the widget pushes the following object:
Use the lower-case action values in your Google Tag Manager triggers. Live Chat supports the following actions:
| Action | Triggered when |
|---|---|
widget_open | The end user selects the widget button and the chat opens. |
widget_close | The end user selects the widget button again and the chat closes. |
eye_catcher_engaged | The end user selects the eye-catcher. The eye-catcher is a small bubble-like text next to the widget, if enabled. |
eye_catcher_dismiss | The end user closes the eye-catcher. |
conversation_opened | The end user selects the start chat button. |
conversation_solved | The conversation is solved. |
conversation_closed | The conversation is closed. |
Configure event tracking [#configure-event-tracking]
If you already integrated Google Analytics and Google Tag Manager on your website, the Live Chat widget automatically sends these events when they are triggered. Otherwise, connect Google Tag Manager and set up Google Analytics(opens in new tab) for your website first.
To configure Live Chat event tracking:
- In the Tag Configuration section, integrate Google Analytics with Google Tag Manager. Provide the Measurement ID(opens in new tab) from your Google Analytics account.
- Download the Live Chat container file for Google Tag Manager(opens in new tab). It contains the tag, trigger, and variable required to track Live Chat events.
- In Google Tag Manager, go to the Admin panel and select Import container to import the file.
- Copy the code snippet that integrates your web application with Google Tag Manager. If you have not done this yet, see Connect Google Tag Manager.
Install the web widget
Add the widget snippet directly to your website.
Content Security Policy (CSP) in Live Chat
Load the widget on websites that use a Content Security Policy.
JavaScript SDK in Live Chat
Control the widget from your website code.
Was this page helpful?