In this article, we'll explain how to make your Certainly bot send data to Google Analytics, and how to visualize Certainly data in your Google Analytics dashboard.
The integration requires the use of a lightweight extension for the Certainly Widget. Please note that it is not possible to use this extension when Certainly is deployed in a different channel, such as Zendesk Chat or Facebook Messenger.
Below, we will cover:
- You have created a chatbot on the Certainly Platform.
- You own an account on Google Analytics with at least one registered property (check out Google's documentation).
Configuring the Certainly Extension
- Embed the Certainly Widget on your website after your Google Analytics snippet. Read about where you can grab the snippet for the Certainly Widget.
- Embed the Certainly Google Analytics extension right after the Certainly Widget. This is the snippet, hosted by Certainly's CDN:
After you finish steps 1 and 2, your webpage should look similar to this:
- Navigate to your chatbot on the Certainly Platform. Make sure your bot is set up to expose Custom Variables to the hosting website.
- Then, add the events you want to send to Google Analytics by setting up the Custom Variable
"ga_event"inside relevant Modules. For example, the following will throw a "Chat Started" event each time the visitor goes past the <md>Starting module:
Make sure the snippet complies with the following structure:
"eventCategory": "Certainly Chatbot",
"eventLabel": "Chat Started",
"eventAction": "Chat Started"
- You can define as many events as you want, but you can only define one event per Module. If you need to send multiple events at once, please split them across multiple consecutive Modules.
- Each event you define will be sent to Google Analytics as soon as your chatbot moves to the next Module in the conversation. If the bot does not move to a Module, the event is never sent to Google Analytics.
That's it—you've now set up your Google Analytics event. Don't forget to save and publish your bot!
Configuring your Google Analytics Dashboard
Your chatbot is now sending events to your Google Analytics property. In order to visualize that data on your Analytics dashboard, you will need to set up some user segments. You can read how to build custom segments in Google's documentation.
For example, the following custom segment includes all website visitors that had a chat with Certainly:
You can configure multiple user segments based on Certainly events. The following custom segment includes all visitors that both (1) had a chat with your Certainly chatbot and (2) purchased something from your webshop:
You can then use your Certainly segments to visualize data inside Google Analytics' Audience Overview:
Additionally, you can use your Certainly segments to visualize data inside Google Analytics' E-Commerce Conversions view:
If you have any questions about Certainly's extension for Google Analytics, feel free to get in touch with us!