How to track user actions within the bot using Google Analytics / Google Tag Manager?

Suppose you’re using Google Analytics (or Global site tag - gtag.js) on your website where the bot is placed. In that case, it’s possible to track user interactions with the bot using your existing Google Analytics account: enable the tracking, and all actions are automatically sent to your analytics account!

To enable go to Bot Settings > Analytics

If you enable reporting as pageviews, you will see these bot action results as virtual pageviews in your Google Analytics reporting:

  • /virtual/bot path/event

Where code name is a step setting, which can be adjusted:

please note that when you change it, the analytics reports relying on the exact steps are going to be changed or reset as well.

Please note: this will most likely blow up your total page views, so it probably makes sense to create a separate view for bot actions and filter out bot page views from your existing reporting:

then from predefined filters, you’d need: Exclude/Include only traffic to the subdirectories: use this filter to exclude/include only traffic to a particular subdirectory (such as /motorcycles or /help/content/faq).

If you want to send events to your Google Analytics (or Facebook for example) you can use this solution.

You can also enable reporting as events, and then the events will be sent like this:

For Google Analytics:

    hitType: 'event',
    eventCategory: 'QB',
    eventAction: '<action>',
    eventLabel: '<bot path>',
    eventValue: {answer}

For Global Site Tag (GA4):

'QB', {
    bot: '<bot path>',
    action: '<action>',
    answer_value_value_0: '1',
    answer_text_answers_text_0: 'Yes',
    answer_start: '2024-05-01T12:50:17.183Z',
    answer_stop: '2024-05-01T12:50:28.808Z'

For Google Tag Manager:

    event: 'QB',
    bot: '<bot path>',
    action: '<action>,
    answer_value_value_0: '1',
    answer_text_answers_text_0: 'Yes',
    answer_start: '2024-05-01T12:50:17.183Z',
    answer_stop: '2024-05-01T12:50:28.808Z'

The avaiable bot actions for the tracking are:

  • Init - bot initialized
  • Load - bot loaded
  • Start - bot started
  • Question/code name - question asked
  • Answer/code name - question answered
  • Answer_edit_start/code name - answer redo started
  • Answer_edit_finish/code name - answer redo finished
  • Leave - the user has made the bot hidden
  • Hide - the bot was hidden (either by the user action or by itself)
  • Return - the user has made the bot visible back
  • Finish - the user has finished the bot flow
  • Exit - the user has exited the bot
  • LiveChat - live chat started
  • LiveChatClosed - live chat closed
  • LiveChatHandedOverToBot - live chat handed over to the bot
  • LiveChatMessageCreated - live chat message created
  • LiveChatMinimized - live chat minimized
  • LiveChatReopened - live chat reopened
  • Redirect - the bot redirected the user to another page
  • Show - the bot was made visible
  • SoftStartOpened - soft start opened

How to send Quriobot events from GTM to GA4 property that is triggered from GTM

When triggered from GTM, GA4 won’t receive custom events that Quriobot is sending to GTM by default, so you’ll need to take such steps in order to implement sending of the events to GA4:

In GTM, create 2 variables, action, bot and answer:

GTM, create a tag of type GA4 event, selecting the previously created configuration:

he event name should be set to ‘QB’ Also, add event parameters:

  • bot with value {{bot}}
  • action with value {{action}}
  • answer with value {{answer}}

In GTM, create a trigger of type Custom Event:

t Event name to QB and select to fire the trigger when Event equals QB

In GTM, select the previously created GTM trigger to fire the previously created GA4 event tag:

How to track the conversion via UTM parameters

An easier approach for tracking the conversion via the bot is to use UTM parameters:

those will be added automatically to any link provided by the bot or an iframe embedded by it.

Please check a more advanced approach to the UTM parameters, if you need to read them from the URL: How to send the UTM parameter(s) along with the response data

There’s also an additional, custom URL parameters setting, in case you need to skip using UTM parameters, for example, for the internal links, as that’s not recommended:

those parameters will be added to the final URL as is, so please have them properly URL-encoded.

Edit this page

See also