Monitoring your Bots with Google Analytics
Flow XO can send messaging activity from your bots to Google Analytics in real time, which gives you a powerful way to supplement the built in analytics dashboard that Flow XO provides. For step by step instructions on how to configure Flow XO to send data to Google Analytics, please see this article.
In this article we will document how the Flow XO / Google Analytics integration works and what data points we send so that you can understand what is available.
Once you configure Flow XO with your Google Analytics tracking code, Flow XO will immediately begin sending every messaging interaction across all of your bots and flows to Google Analytics as events. At this time, only messaging interactions are sent - meaning messages sent or received through a bot. Non-messaging steps in your flows, such as Google Sheets queries, attribute lookups, etc, are not transmitted.
For each message send or received by a bot in Flow XO, Flow XO will send an event with the following properties:
|GA Attribute||Flow XO Value||Description|
|Event Category||Bot Platform||The Bot Platform is the underlying platform the bot is hosted on. Possible values are: messenger, telegram, slack, web and twilio.|
|Event Action||Message Direction||Whether or not the message was 'sent' or 'received'|
|Event Label||Bot Action or "Intent"||The value of this field depends on whether a message is being sent by your bot or received from a user.
Sent Message: For messages being sent by your bot, this will be the name of the task that sends the message. For instance, if you send a message use Send a Message task and don't rename it from the default, the Event Label will be "Send a Message".
Received Message: For messages received by your bot, the "Intent" is based on a number of factors, considered in this order:
* For messages that were 'unhandled' - meaning they were completely ignored by your bot - the intent will be 'unhandled'
* For messages that did not match any keywords or intent detection triggers and were handled by a catch all flow, the intent will be 'catch_all'
* For messages that were classified by one of our AI intent detection triggers such as Dialogflow or Wit.ai, the intent will be the actual intent name that the integration returned. Please note: this will ONLY apply when you use the Dialogflow or Wi.ai integration as a Trigger. If you use the integration as an action, the intent will not be detected.
* If the message triggered a new workflow, the name of that workflow will be used
* If the message represented a request from the user to end the chat (ie by typing "Bye") then "abandon_chat" will be used
* If the message is a reply to a question, then the intent will be "Reply To" + the name of the Question task
* If none of the above is true, then the intent will be "unknown_intent"
Because the Event Label / Intent is the best way to observe how users are interacting with your bots, when you use the Google Analytics integration, it is very important to give all of your workflows, triggers and tasks good descriptive names instead of the default names that Flow XO assigns.
|User Lang||Language||The language code configured on your bot in the bot setup screen|
|Data Source||'fxo'||This is currently a card-coded value of 'fxo'|
|Path||See notes||When an event is sent to Google Analytics, it can be associated with a specific webpage. Because Google Analytics was designed to track website performance, a lot of its functionality revolves around web pages. Since a bot doesn't have a webpage, we are constructing a synthetic webpage path that uses the following formula:
Where 'message_type' is the kind of message - such as 'overhear', 'direct message', 'sent message', etc.
Here's an example of a message sent to a customer by our web bot:
/web/Flowbot/sent/Only shown on first connection?message_type=sent_message
|Document Title||Bot Name||The 'Document Title' in Google Analytics is a human friendly name of a page. We use the Bot Name in this spot.|
|Custom Dimension 1||Bot Platform||We put the Bot Platform in the Custom Dimension 1 slot. If you are using a freshly created Google Analytics property, you can set up custom dimensions in the same order and with the same names as the custom dimensions we are sending and use those dimensions to create Segments.|
|Custom Dimension 2||Plan Name||This is your plan name. It will be 'standard' or 'free'|
|Custom Dimension 3||Bot Name||The name of the bot that send or received the message|
|Custom Dimension 4||Effective Intent||The same value as the Event Label above, for received messages|
|Custom Dimension 5||Bot Action||The same value as the Event Label above, for sent messages|
Useful Google Analytics Reports
Because we are using Google Analytics to monitor bot activity, and not actual webpage interactions, the full scope and breadth of Google Analytics does not apply to monitoring your bots. However, there are still a lot of reports and Google Analytics features that will be extremely useful. Here are a few of our favorites
This realtime report shows how many users are engaging with your bot any at given time. By default, the Event Category and Event Action are displayed in the table, which will show the platform and message direction of current messages. But a more interesting view (shown in the screenshot above) is available if you click on one of the platforms, such as 'web' - you can then see the actual parts of your flow that your users are currently interacting with.
The events overview report will show you trends in messaging volume over time. Particularly useful is the ability to drill into the Event Category, Event Action or Event Label in the section called "Top Events". This lets you see how frequently users interact with various aspects of your conversations.
Events: Events Flow
The Events Flow report is a very powerful report that will allow you to observe how your users tend to move through your conversations, and where they drop off. This will help you troubleshoot problematic or frustrating parts of your conversation design, or determine where your users are showing the most interest or getting the most value.
Conversions & Goals
A very important feature of Google Analytics is the ability to measure and track conversions and goals. A conversion/goal is any action you want your users to take. Setting up and using goals is beyond the scope of this article, but there is a lot of information about it on the web (here is Google's article on setting up goals). When setting up goals for Flow XO bot interactions, you can use either a Page or an Event as your goal triggers. The easiest (and recommended) approach is to use the Event Label when defining your goals, and to carefully name each of your flow steps, especially ones that you want to use as a goal target. Here's a quick example of what that might look like in the goal setup form:
So that's it for our introduction to using Google Analytics with Flow XO. As always, please feel free to reach out to email@example.com if you have any questions or run into any issues using this powerful new tool.