To integrate Google Analytics event tracking,

  1. Go to analytics.google.com (Google Analytics) and login with your credentials.
  2. Open the source code/main script of your website. 
  3. Copy the entire script at this link and paste it on your website. This is a sample script. 

  4. Modify the following lines,


token: "WEB_CHAT_TOKEN",
gtag('config', 'UA-XXXXXXXX-1');
ga('create', 'UA-XXXXXXXX-1', 'auto', 'FreshchatEvents');


  1. Go to Web Messenger Settings in Freshchat.

  2. Copy the token value in Step 2.

  3. Replace it with “WEB_CHAT_TOKEN” in the above lines.

  4. Go back to Google Analytics (GA) page.

  5. Click Admin.

  6. Select User Management.

  7. Click Tracking Info and then select Tracking Code.

  8. Copy the tracking ID.

  9. Paste it in the script, replacing it with "UA-XXXXXXXX-1".

  10. Go to tagmanager.google.com and login with your credentials.

  11. Select the required Container. You will redirected to the Workspace page.

  12. Click Add a new tag. A window appears.

  13. Enter the Tag title.

  14. Click Tag Configuration. The Choose tag type window appears.

  15. Select Custom HTML.

  16. Paste this code in the HTML text area.

  17. Select the Support document write option.

  18. Click Advanced Settings.

  19. Select Only fire this tag in published containers option.

  20. Click Triggering.

  21. Select All Pages. Click Add.

  22. Click Save. You will be redirected to Workspace.

  23. Click Submit. The Submit Changes window appears.

  24. Enter the Version Name and Version Description.

  25. Click Publish.


You can also refer the following video, which demonstrates the above steps.

https://www.useloom.com/share/9d65daaa4cc04ff682ab38de7c9dd19d