1. Open the source code / main script of your website. Make sure that you copy and paste the entire script that you find here. This is a sample script. Alll you need to do is make changes to the following lines:
ga('create', 'UA-XXXXXXXX-1', 'auto', 'FreshchatEvents');
2. For the web token, you will find it here in the web messenger settings of Freshchat.
3. Copy just the unique token ID in the above script, replacing "WEB_CHAT_TOKEN".
4. Next, open the admin section of Google Analytics (GA).
5. Go to "User Management".
6. In the next tab, click on Tracking info >> Tracking Code.
7. Copy the tracking ID, which looks like this - UA-XXXXXXXX-1
8. Paste this tracking ID in the above script, replacing "UA-XXXXXXXX-1".
9. Next, open the admin section of Google Tag Manager.
10. Make sure to select the right "Container".
11. Click on the desired one and click on "Add a new tag".
12. Rename the next window / card which opens >> Under Tab Configuration >> Choose a new tag >> Select "Custom HTML".
13. Paste the entire code which can be found here along with the script from above.
14. Check the box which says "Support document write".
15. Go to Advanced Settings >> Check the box which says "Only fire this tag in published containers".
16. Next, click on "Triggering" and select on "All pages" when the next window / card opens.
17. Don't forget to hit "Save".
18. Next, click on "Submit" and rename the "Version Name" and enter the description.
19. Click on "Publish".