Table of Contents

Google Analytics - Track Events (Not embedded)

Pau Sanchez Updated by Pau Sanchez

This process is only suitable for standalone landbots. If you're landbot is embedded in your website, check our guide here

for landbot (Web)

Google Analytics (analytics.js)

When your bot is not embedded, is using the url given in the Share Section:

Add your Google Analytics ID straight in the chatbot flow, as well as configure your Event Action and Event Category with just a few clicks!Β Learn how!

Make sure you put theΒ Google Analytics EventΒ right after the block that means the conversion for you!
  1. First, create a new Google Analytics type block:
  2. Now, if this is the first time you configure a Google Analytics integration, you'll need to add the Google Analytics ID first:
    1. Click on the Landbot Settings link on top:
    2. You'll be redirected to the SEO & Tracking section of your bot. On the right side, add your Google Analytics ID under the field with the same name:
    3. Click Apply changes at the bottom and then Save & Publish on the top-right corner to save your ID:
  3. If you've already gone through this step, all you have to do is:
    1. Add an Event Category.
    2. Add an Event action.
    3. Click on Advanced Options, where you'll be able to:
  4. If you're done configuring your event, click Save to save your changes. Every time a user goes through - triggers - that block, the event you've just configured will trigger too!

Google Analytics 4 (GA4)

In this case you will need to make sure the GA Analytics property is the url of the bot

Get tracking code from GA:
  1. First you need to make sure your site has the tracking snippet from GA4, to find the snippet go to ADMIN > Setup Assistant > Tag Installation > Web and select your site > Tagging Instructions:
  2. Select Global Site Tag (gtag.js) and copy the snippet

What to edit in your bot (Landbot builder):

  1. Paste the snippet in the Settings > Seo Tracking > Custom Tracking Snippets section:

  1. Now in the builder we will add a Code block, in the step of the flow where we want the event to be triggered, in the example below we want to track once the chat has been initiated:
  1. Replace the parameters with your own values:
window.gtag('event', 'start chat')

Change "start chat" for the name of the event desired

Test the event:
  1. Once the setup above is complete you can test the event by using the bot and arrive to the step where the code block is. After few seconds (15 seconds more or less) you should be able to see your event in the real time section:

for Whatsapp

For a list of all the blocks and current functionalities with Whatsapp bots, please check here

This block/functionality is not compatible with Whatsapp

for Messenger

This block/functionality is not compatible with Messenger

FAQ & Troubleshooting

How can I check if the tracking is working correctly?

When using Google Chrome extension Google Tag Assistant if the tracking of an event has been done correctly you will see a screen similar to this one:

How did we do?

Google Analytics - Track Events (Embedded)

Contact