Connecting goals in Quriobot to a marketing tag from Quriobot is very easy to do! On this page you can find two examples for Google Analytics and the Facebook pixel. 


If you want to follow everything in Google Analytics please use this explanation instead


Google Analytics:

To track custom events via Google Analytics, you can make use of the analytics JS API and the 'script' chat text type: 

function () {
        ga.getAll()[0].send({
        hitType: 'event',
        eventCategory: 'Quriobot',
        eventAction: 'Started',
        eventLabel: window.location.href
    })
}


You can add the code above to any SCRIPT chat message (developer mode has to be enabled) (select this in the drop-down on the right side) within the bot when you want your event to be tracked:


Note that in this example we use the first existing GA tracker.

Alternatively, you can create a new one:


function() {
    ga('create', 'UA-XXXXX-Y', 'auto', 'tracker1');
    ga.getByName('tracker1').send({
        hitType: 'event',
        eventCategory: 'Quriobot',
        eventAction: 'Started',
        eventLabel: window.location.href
   })
}



Facebook pixel

For launching the Facebook pixel you will need the code below. Within that code you configure your Facebook ID (id=) and you configure the Event (ev=) you want it connected to.

This example makes use of a <noscript> logic to able to use these within the bot HTML chat message type by launching an invisible pixel which in term is connected to the Facebook service.

<p style="display: none">1</p>
<div style="border-radius: 9px; overflow: hidden">
<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=XXXXXX&ev=test&noscript=1"/>
</div>



You can add the code above to any HTML chat message (select this in the drop-down on the right side) within the bot when you want your tag to be launched:

Note: If you want to use more parameters to connect with please find more info here: http://randomproblems.com/use-facebook-img-tag-fire-pixel-events/


Important note: please keep (local) rules about tracking people in mind and make sure you ask for permission.


Using GTM data layer to send the events


Steps:


1. Enable developer mode in QB

2. Set up the data layer push scripts per step (eg Start and finish)

3. Create a custom variable in GTM of the data layer variable type and you call that, for example, conversion_type

4. Create GTM triggers for, for example, chatbot started / finished from other intermediate steps where the data layer is fired.

5. Choose chatBot as the event name (that is the event name in the data layer push)

6. Choose a few adjusted events for the trigger

7. Choose conversion type is the same as the data layer variable (eg Chatbot started or chatbot ended)

8. Create a tag that is triggered by the above

choose as Category eg Chatbot

choose as Action: {{conversion_type}}

In the end, you have something like that in GTM:


The great thing is that you can fire conversions from GTM to Google Analytics, Google Ads, Facebook and other channels in one fell swoop.



Need more help or looking for inspiration? Join the Quriobot community!

Quriobot
Friendly & Fun
Interact & Convert



JS API