You can easily add your Google Analytics tracking code to any of your chatbots, in order to track visitor behaviour and demographics.

Here is how you need to go about it :

1. On your Google Analytics home page, select the account you want to integrate your Tars with and copy the property ID behind the name/URL of that account. It takes the form UA-XXXXX-Y or UA-XXXXX-YY.

2. Open your Tars dashboard, load up the chatbot you want to track, and click the Configure >> Analytics and Tracking (highlighted below).

3. In the Google Analytics section (highlighted above), and enter your code into the field.

4. Now open your Tars bot in a couple of windows(one in Incognito window), and go through the chat if you feel like it.

5. Open your Google Analytics account where you are tracking this Tars bot.

6. Go to Real time >> Overview section and you should be able to see a live user on your bot link. This means that your Google Analytics code in the bot is working.

6. To see detailed activity on your chatbot across a defined timeline, go to the Behaviour panel, select Site Content, then click on All Pages.

7. Get your Chatbot’s URL and copy its ID. It’s the last string of characters in the URL, after the last “/”, and should be something similar to “Nk_IhasIx”.

8. Search for the Tars Chatbot ID in the search box for the All Pages report and you should see the entire activity like this - 

Tracking conversions

On every action(meaning chat messages exchanged between the bot and user) in your bot, we also send a Google Analytics event with the following parameters:

  • Category will be passed as "TARS_ChatbotID" 
  • Action represents the Gambit name
  • Label represents the user response to a particular gambit

Sending events is not enabled by default in your bots and you need to enable it in the dropdown below the field where you added your Google Analytics code in Tars dashboard.

You can find all the Tars Chatbot conversations in Google Analytics in the Behaviour > Events > Overview report.

Setting Goals

To see how to use this event to set up Goals (for easier use in other reports, like conversion tracking), please refer to this Google Analytics help article

I will also take you through setting up Goals from the Events that are being tracked.

1. Open your Google Analytics dashboard, go to View column and click on Goals.

2. On the next screen, click on + NEW GOAL to start defining the new goal parameters you want to set up.

3. On the next screen, click on Custom in the Goal Setup window and click on Continue.

4. The next step is to give your Goal a description to recognise it later when you have multiple goals set up. Also, choose the goal type as "Event", then click on Continue.

For instance, in this example - I have named my goal as "Filled Leaving City" since I wanted to track how many users have shared this data in my bot. In your case, it could be something like "Shared Phone Number".

5. Now this is the most critical step since this is where you define which event should be considered as a goal. In this example, I am considering my goal as all those users who have shared the response "leaving_city' gambit in my bot.

So this is what I do (remember Action represents Gambit Name)

In your case, if you want to consider people who have shared their phone number as a goal and you have "Phone" as the gambit name in your bot - you should make Action equals to Phone

That's it. Just click on Save and you have now created a Goal.

Do note that it takes some time for the events to be reflected in goals. So don't panic right away, wait for a few hours and your events will start reflecting in goals.

Did this answer your question?