Serviceform academy logo
Login
Search
Google Analytics 4

Sending custom data from Serviceform tools to GA4

Learn how to collect data from user interactions in Serviceform tools.

The following is a list of the integrations supported by our system, highlighting key features and benefits. Click on any of the below integrations to explore detailed guides and connect the right tools to your system(s).

Native integrations

If you're not yet familiar with Google Tag Manager and Analytics, don't worry! We've got you covered. Check out our previous articles (Setup & send data) for a step-by-step guide to get you up to speed. This article mainly focuses on the following:

      • Sending data from Serviceform tools.

How to send data from Serviceform tools?

The Defaults events initiated by the Serviceform tool are sent via the Data layer.

• Sending data from the questions in the chat flow

You can create and send custom events to the Data layer which can be then forwarded to Google Analytics via Google Tag Manager.

1. Login to your Serviceform account and select your preferred tool under Tools section.

2. Navigate into the Flow section.

3. Choose an element in the flow builder that you want to trigger a custom event.

4. Click on Actions and add a new action to the selected element.

5. Select Run Custom JS(Javascript).

6. Under Custom Javascript, type the javascript code to push the event to the data layer. You can name your event, i.e. button_push, according to your preference.

          window.dataLayer.push ({'event': 'button_push'});

7. Once you have saved and published the chatbot in your Website, you can receive the custom events from the chatbot when the element is triggered.

8. Open Google Tag Manager and set up a trigger to listen to the custom event.

9. Create a Tag in Google Tag Manager in order to send the data to Google Analytics.

10. Navigate to the Google Analytics dashboard, click on Reports, then proceed to Engagement and finally select Events. You can find the custom event that was pushed from your Chatbot to Tag Manager and subsequently to Google Analytics.

• Sending custom event for every live chat request

You can send a custom event to the dataLayer when the live chat is initiated.

1. Navigate to the Tools installations page and click on + Add new rule.

2. Type "/" as the link and select Custom js.

3. Enter the following code by replacing Type here with your preferred text.

window.sfDatalayerMessage = 'your message';

4. Enable the rule and click on Save rules.

Once the custom rule is saved, the 'service_message" event would be pushed to the dataLayer along with the text which was manually entered in step 3.

window.dataLayer.push({    

   'event': 'serviceform_message',    

   'chatProgress': window.sfDatalayerMessage});

By following these steps, you can seamlessly connect your Serviceform chatbot with Google Analytics through Google Tag Manager. It's like setting up a virtual handshake for your chatbot and analytics - easy and effective! Once everything is set up, you can track all your chatbot events effortlessly. Note that it would take up to 48 hours for the data to be updated in Google Analytics. Happy tracking!