Skip to main content

Channels

Track ads in your chatbot

See which Google Ads, Meta ad or campaign each chatbot visitor came from, let your agent save it with the lead, and count chatbot leads as conversions in Google Ads.

Think of it as a stamp on every visitor's hand: when someone clicks your Google Ads ad (or a Meta ad, or a campaign link) and later talks to your chatbot, Nirvai remembers where they came from. You see it in your inbox, your agent knows it, and Google Ads can count the lead as a conversion. There's nothing to set up in the chatbot — the same embed code you already have does it.


How it works​

Every ad click lands on your site with a link like this one. The chatbot reads it — and keeps it for 30 days, so it still counts if the visitor browses other pages or comes back days later before opening the chat.

The link a visitor arrives with from your ad

https://yourstore.com/trucks?gclid=Cj0KCQiA8q…&utm_campaign=fleet-spring&keyword=gps+for+trucks&utm_medium=cpc
gclidThey clicked a Google Ads adGoogle adds it on every click
utm_campaignWhich campaignYou add it (optional)
keywordThe keyword that showed the adGoogle fills it in (optional)
utm_source / utm_mediumPaid traffic and its networkYou add it (optional)
1Click on the adGoogle sends the visitor to your page with the link above.
2Your websiteThe same chatbot code as always reads the link — nothing to change.
3They chatDays later or right away: the source travels with the conversation.

If a visitor clicks several ads, the latest ad click wins. A later visit without an ad never erases it.


Where you see it​

In your agent's Conversations, visitors from an ad get a pill on their row, and the chat shows the campaign, keyword, the page they landed on and when.

Your inbox in Nirvai

Camila Rojas10:42Quote for 12 trucks Google Ads
Visitor #455110:15Opening hours
Diego MuñozYesterdayDo you ship to Arica? Meta Ads
Camila RojasQuote for 12 trucks
Google Ads· Campaign fleet-spring · keyword “gps for trucks” · landed on /trucks · Nov 9, 10:41
Hi, how much is GPS tracking for 12 trucks?
Hi Camila! For a fleet of 12 the Pro plan fits best — want me to book a 15-minute demo?

Only conversations that start after this feature was turned on carry a source.


Your agent knows it too — save it with the lead​

Your agent is told where each visitor came from, so it can mention the right product of that campaign and, when it saves the lead, store the source alongside it. Add these columns to the database where your agent saves leads:

Your “Leads” database

NameEmailSourceCampaignKeywordgclid
Camila Rojascamila@transportesur.cl google_adsfleet-springgps for trucksCj0KCQiA8q…
Diego Muñozdiego@ferreteria.cl meta_adsblack-friday——
Ana Sotoana@clinica.cldirect———
Filled in by your agent while it saves the lead — you only add the columns.

Then add one line to your agent's instructions, for example: "When you save a lead, always fill in Source, Campaign, Keyword and gclid."

Why keep the gclid?

It's the ID of the exact ad click. With it you can later tell Google Ads "this lead became a sale", so Google learns which ads bring customers — not just clicks.


Count chatbot leads as conversions in Google Ads​

The chatbot sends three events to your site's tags (Google Tag Manager or gtag.js):

EventWhen it fires
nirvai_chat_openThe visitor opens the chat
nirvai_chat_startedThe visitor sends their first message in a conversation
nirvai_leadThe visitor sends the contact form

To count leads in Google Ads with Google Tag Manager: create a trigger of type Custom Event with the event name nirvai_lead, and attach your Google Ads Conversion Tracking tag to it. No personal data is sent to your page — only the event and the source.

To report what happens after the chat (a qualified lead, a meeting, a sale), connect Google with the Google Ads service in Credentials and give your agent the Google Ads – Upload Conversion tool: it sends the conversion with the stored gclid.


Optional: campaign and keyword names​

The gclid alone tells Nirvai "this came from Google Ads". To also see the campaign and keyword, add this in Google Ads under Campaign → Settings → Campaign URL options → Final URL suffix:

utm_source=google&utm_medium=cpc&utm_campaign={campaignid}&keyword={keyword}

Google fills in {campaignid} and {keyword} on every click. For a readable campaign name, write it instead of {campaignid} (e.g. utm_campaign=fleet-spring).


Try it without running ads​

Open any page with your chatbot adding this to the address, then open the chat in a private window:

?gclid=TEST123&utm_source=google&utm_medium=cpc&utm_campaign=test&keyword=chatbot

Send a message: the conversation shows Google Ads · Campaign test in your inbox. In the browser console, type dataLayer to see the events.


Troubleshooting​

What you seeWhy / what to do
No pill on a conversationIt started before the feature, or the visitor arrived without an ad link. Test in a private window — a browser that already chatted keeps its earlier conversation.
Google Ads, but no campaignThe link only had gclid. Add the Final URL suffix above.
Tag Manager doesn't see nirvai_leadThe trigger name must be exactly nirvai_lead (Custom Event), and the visitor must send the contact form.
Your site needs consent before storing ad dataAdd window.nirvaiChatSettings = { storeAttribution: false }; before the chatbot code: the current visit still counts, nothing is stored for later visits.

What's next​