How to track events on Google Analytics via Google Tag Manager?

This article will guide you on how to track the HappyFox Chat related events on Google Analytics using Google Tag Manager.

A. Enable Google Analytics on HappyFox Chat:

Step 1: Login to your HappyFox Chat Account.

Step 2: Go to Apps → Google Analytics.

Step 3: Click on INSTALL button.

Step 4: Click on Enable button on the resultant page.

B. Configure Google Analytics using Google Tag Manager:

Step 1: Log in to your Google Tag Manager account.

Step 2: Click on New Tag >> Name your tag.

Step 3: Now click the tag configuration and choose Universal Analytics

Step 4: Click the dropdown under Google Analytics Settings >> Choose New Variable.

 

Step 5:  Enter your Google Analytics Tracking ID >> Click Save >> Rename your Variable type as "Google Analytics Settings" >> Click Save.

Step 6: On the new window >> Click Add Trigger >> Set up the firing rule.

Step 7: Click Add and hit Save.

C. Configuration to track live chat events:

Step 1: Click New Tag >> Name your tag.

Step 2: Now click the tag configuration and choose Universal Analytics.

Step 3: Now choose Event from Track type drop down.

Step 4: Under Event Type Parameter Settings, Click the macro button across Category field. 

Step 5: Click on "+" symbol to create a new variable type >> In the new window click Variable configuration tile. 

Step 6: Choose Data Layer Variable as the variable type. 

Step 7: Name the Data Layer Variable as "eventCategory" and Save.

Step 8: You will be prompted to rename your Variable >> Type "gaLiveChatCategory" as the name of Variable and hit Save.

Step 9: Similarly for Action field, you will create a new variable. Choose variable type as Data Layer Variable >> Enter Data Layer Variable as eventAction, click Save and rename it as gaLiveChatAction.

Step 10: For Label field, you will create a new variable. Choose variable type as Data Layer Variable >> Enter Data Layer Variable as eventLabel, click Save and rename it as gaLiveChatLabel.

Step 11: For Value field, you will create a new variable. Choose variable type as Data Layer Variable >> Enter Data Layer Variable as eventValue, click Save and rename it as "gaLiveChatValue".

Step 12: Once all these variables are set up, click Save >> Now you will be asked to Add Trigger.

Step 13: Click on "+" symbol to choose trigger type.

Step 14: ChooseCustom Eventoption on the new window.

Step 15: Name the custom event as "LiveChat" and click Save.

Step 16:  You will be prompted to rename your Trigger >> Enter "gaLiveChatRule" and Click Save.

Step 17: From Google Analytics Settings drop-down list beneath the Value field choose the {{Google Analytics Settings}}.

Step 18: Click Save >> Submit and Publish the tag. 

HappyFox chat events on Google Analytics:

On Google Analytics account, under Reporting tab → click Real-Time → choose Events. You can see the chat widget events are being logged under HappyFox Chat category.