Home / Dialogflow CX / How to download Dialogflow CX conversation history
Dialogflow CX

How to download Dialogflow CX conversation history

Check out my courses Learn Dialogflow ES and Learn Dialogflow CX if you would like to learn Dialogflow in depth. 

As of this writing, there is no simple way to see the conversation history of your Dialogflow CX bot. Unfortunately this means you don’t have a good idea of how people are interacting with your bot.

In this tutorial, I explain how you can use existing Google software to download the history of your Dialogflow CX bot.

Enable StackDriver logging

First, in the settings of your bot, click on the “Enable StackDriver Logging” in your Dialogflow CX bot’s agent settings.

Note: the logs are only collected AFTER you check this box. That is why, in my Dialogflow Tips, I tell people that this is the first thing they should do.

Filter for Dialogflow logs

Once the user has interacted with your CX bot, click on the link next to the “Enable StackDriver logging” checkbox. This will take you to StackDriver logs explorer.

Note: You can also export StackDriver logs to BigQuery, but it is not very friendly for technical non-programmers when compared to the approach I am describing here.

In the Logs Explorer, use the Log name Filter button on the top. You see that Dialogflow is one of the filter options.

Check the Dialogflow option (which will automatically check the “requests” checkbox).

Choose a time range

When you first choose the filter and click on the Add button, you will probably see that the logs are empty unless your bot already has a lot of user interaction.

Now choose an appropriate time range (the link is on the top right of the page, below the search bar) such as 7 days and click on Apply button.

Now you will see more logs appear below.

Download the logs

Click on Actions button above the logs and choose “Download logs”

Now choose the maximum number of log entries to download. And then choose either CSV or JSON as the download format. Then click the Download button.

CSV format

The CSV format has a lot of columns, and looks like below.

A few things to note about the CSV format

  • there are a lot of columns, and the number of columns is proportional to the depth of the object hierarchy of the log format (which is chosen by Dialogflow and isn’t something you can configure)
  • the request and response logs appear on alternate rows
  • the response JSON just has [Object object] and doesn’t have the full details

JSON format

The JSON format has more details and is better structured (because the “queryResult” field includes the input query).

If you download the logs in JSON format, you can use the BotFlo app to convert the StackDriver JSON logs it into a CSV format which will make it easy for you to analyze your bot’s conversation history and calculate the accuracy of your bot. Unlike the CSV file you get from directly exporting from StackDriver, the BotFlo app also provides the full Response message (which is in JSON format) in the CSV file.


The BotFlo app gives you many tools which can speed up your Dialogflow bot development

This website contains affiliate links. See the disclosure page for more details. 
"The magic key I needed as a non-programmer"

The custom payload generator was the magic key I needed (as a non-programmer) to build a good demo with rich responses in DialogFlow Messenger. I've only used it for 30 minutes and am thrilled. I've spent hours trying to figure out some of the intricacies of DialogFlow on my own. Over and over, I kept coming back to Aravind's tutorials available on-line. I trust the other functionalities I learn to use in the app will save me additional time and heartburn.

- Kathleen R
Cofounder, gathrHealth
Check out my YouTube courses

Dialogflow CX Beginner Tutorial

Dialogflow ES vs CX using a Decision Tree Bot

Intro to NLU for technical non-programmers

Better Dialogflow ES Bots Using the CTFS Framework

Search the autogenerated transcripts of all my YouTube videos
In this free course, I provide some tips for managing large Dialogflow ES bots without compromising on accuracy.

Similar Posts