Table of Contents

Google Adwords - How to track Google Adwords in Landbot copy

Pau Sanchez Updated by Pau Sanchez

There are two approaches depending on your user case:

  1. Bot is embedded in a site

When your bot is embedded in one of the four different ways available: Fullpage, Popup, Embed or Livechat (with custom domain).

  1. Bot is not embedded, using a standalone url (share url) given by Landbot

When your bot is displayed with a Share URL (with Landbot domain)

In Landbot 3

Bot is embedded in a site
Important: Do not use the Googles tracking code on the Landbot side (leave the Google Analytics ID field blank on Settings > SEO & Tracking) to make sure it doesn’t duplicate visitors.

You should apply this process when landbot is embedded into your website - using a domain that’s different from “landbot.io”. This process is very useful to track ads conversions.

How the code in your site is going to look like with the snippets in these instructions:

<html>

<head>


<script async src="https://www.googletagmanager.com/gtag/js?id=AW-946649654"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'AW-946649654');
</script>

</head>

<body>

</body>

<script SameSite="None; Secure" src="https://cdn.landbot.io/landbot-3/landbot-3.0.0.js"></script>
<script>
var myLandbot = new Landbot.Livechat({
configUrl: 'https://chats.landbot.io/v3/H-649063-J3R93HLW0CGPFOY5/index.json',
});
</script>
</html>

What to edit in the Site (container):
  1. Be sure you're using a standard Google tracking implementation like this one:
In the code below, please change the AW-9488776641 for your Google tracking code


<script async src="https://www.googletagmanager.com/gtag/js?id=AW-946649654"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'AW-948877664');
</script>

  1. Add your Landbot to your container’s webpage using the snippet provided by the app:
<script SameSite="None; Secure" src="https://cdn.landbot.io/landbot-3/landbot-3.0.0.js"></script>
<script>
var myLandbot = new Landbot.Livechat({
configUrl: 'https://chats.landbot.io/v3/H-649063-J3R93HLW0CGPFOY5/index.json',
});
</script>

What to edit in your bot (Landbot builder):
  1. In your chatbot builder, add this code to a Code block, after the Welcome Message - or the one that goes right after what you consider a conversion, (e.g. Ask a question > Email). This is the point in the flow when you want to send the event to track:
window.gtag('event', 'conversion', {'send_to': 'AW-948877664/CONVERSION_LABEL'})

Bot is not embedded, using a standalone url (share url) given by Landbot)

If you are not planning to embed Landbot in any of it's shapes, you just will share the url with the Landbot domain, this is the way to add tracking to events:

  1. With AdWords conversion tracking you can see how effectively your ad clicks lead to valuable customer activity. This article explains how to create a conversion action to track customer actions on your Landbot.
    1. The first step is going to your Adwords account:
    1. Now, click on Conversion
    1. Select the kind of conversation you want to track:
    1. Now, set up the tag you want to add to your Landbot
    1. Select the first option of the Global site tag list (if you haven't installed the global site tag on your website): 
    1. In your Landbot account go to SETTINGS > SEO & TRACKING > Custom Tracking Snippets and Paste the “Adwords Global Site Tag” into that field:
    1. Add the “Page load” code in the “thank-you message” of your landbot (when you want to trigger the conversion after capturing the email or the interesting data for your business):
    gtag('event','conversion',{'sent_to':'AW-946649654/X675CMzst4EBELb2ssMD'});
    1. Check it with Google Tag Assistant chrome extension:
    ...and:
    You should be good to go! 

In Landbot 2

Bot is embedded in a site
Important: Do not use the Googles tracking code on the Landbot side (leave the Google Analytics ID field blank on Settings > SEO & Tracking) to make sure it doesn’t duplicate visitors.

You should apply this process when landbot is embedded into your website - using a domain that’s different from “landbot.io”. This process is very useful to track ads conversions.

How the code in your site is going to look like with the snippets in these instructions:

<html>

<head>


<script async src="https://www.googletagmanager.com/gtag/js?id=AW-946649654"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'AW-946649654');
</script>

</head>

<body>

</body>

<script src="https://static.landbot.io/landbot-widget/landbot-widget-1.0.0.js"></script>
<script> var myLandbot = new LandbotLivechat({
index: 'https://landbot.io/u/H-222098-Z7UGOMG4SI4TMMVP/index.html', });
</script>


<script>
myLandbot.on('gAdsLandbot', function(){
gtag('event', 'conversion', {'send_to': 'AW-948877664/CONVERSION_LABEL'})
});
</script>

</html>

What to edit in the Site (container):
  1. Be sure you're using a standard Google tracking implementation like this one:
In the code below, please change the AW-9488776641 for your Google tracking code


<script async src="https://www.googletagmanager.com/gtag/js?id=AW-946649654"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'AW-948877664');
</script>

  1. Add your Landbot to your container’s webpage using the snippet provided by the app:

<script src="https://static.landbot.io/landbot-widget/landbot-widget-1.0.0.js"></script>
<script> var myLandbot = new LandbotLivechat({
index: 'https://landbot.io/u/H-222098-Z7UGOMG4SI4TMMVP/index.html', });
</script>
  1. Add this code to the footer of your container’s webpage where landbot will be located (add it after the Landbot snippet of step 1), with the specific values of your tracking code:


<script>
myLandbot.on('gAdsLandbot', function(){
gtag('event', 'conversion', {'send_to': 'AW-948877664/CONVERSION_LABEL'})
});
</script>

What to edit in your bot (Landbot builder):
  1. In your chatbot builder, add this code to a Code block, after the Welcome Message - or the one that goes right after what you consider a conversion, (e.g. Ask a question > Email). This is the point in the flow when you want to send the event to track:
Landbot.send('gAdsLandbot');

Bot is not embedded, using a standalone url (share url) given by Landbot)

If you are not planning to embed Landbot in any of it's shapes, you just will share the url with the Landbot domain, this is the way to add tracking to events:

  1. With AdWords conversion tracking you can see how effectively your ad clicks lead to valuable customer activity. This article explains how to create a conversion action to track customer actions on your Landbot.
    1. The first step is going to your Adwords account:
    1. Now, click on Conversion
    1. Select the kind of conversation you want to track:
    1. Now, set up the tag you want to add to your Landbot
    1. Select the first option of the Global site tag list (if you haven't installed the global site tag on your website): 
    1. In your Landbot account go to SETTINGS > SEO & TRACKING > Custom Tracking Snippets and Paste the “Adwords Global Site Tag” into that field:
    1. Add the “Page load” code in the “thank-you message” of your landbot (when you want to trigger the conversion after capturing the email or the interesting data for your business):
    gtag('event','conversion',{'sent_to':'AW-946649654/X675CMzst4EBELb2ssMD'});
    1. Check it with Google Tag Assistant chrome extension:
    ...and:
    You should be good to go! 

Channel Type compatibility

for Web

This feature is fully compatible.

for WhatsApp

This feature is not compatible with WhatsApp.

for Messenger

This feature is not compatible with Messenger.

How did we do?

Contact