This Google Tag Manager Recipe was originally posted by Ryan Praskievicz.
It allows you to track Drift chat’s interactions and pass that data to Google Analytics. The list of supported events: chat sidebar opened, chat closed, message sent, conversation started, welcome message opened, welcome message closed, campaign clicked, campaign submitted, and several others.
INSTRUCTIONS
- Download Container File
Download the container JSON file (right-click on the link and click “Save Link As” or “Save Target As” to save the JSON file to your computer). - Import JSON File into GTM
Log into your own Google Tag Manager container and head to the Admin section of the site. Under Container options, select Import Container. Read this blog post for more details about importing a container file. - Update With Your Own Google Analytics Tracking ID
Open GA Event – Drift Interaction tag, and replace the tracking ID, You have two options here:- Replace the {{YOUR_GA_TRACKING_ID}} with the Constant Variable of the same name YOUR_GA_TRACKING_ID which contains GA Tracking ID.
- Recommended: Untick the Enable overriding settings in this tag checkbox in GA Event Tag and select GA Settings Variable in its dedicated drop-down field
- Preview & Publish
Use the Preview options to test this container on your own site. Try testing each of the events to make sure they’re working properly. If everything looks good, go ahead and publish!
View all 40+ Google Tag Manager Recipes