How your AI agent can tell which ad brought the customer
Check the ad field in the incoming AnyLinga request. It contains ad data if the customer messaged you from a Meta ad: Click-to-WhatsApp through the WhatsApp Business API, a Messenger ad, or an Instagram Direct ad. Otherwise, ad is null.
Pass this data to your AI in your n8n workflow so it can see which ad brought the customer and respond about that offer. AnyLinga passes messages between the customer and your AI; you keep your own model and prompts.
What data is in the ad field
Use the ad headline and body as context for your AI. The other fields describe the channel and source of the inquiry.
| Field | Contents |
|---|---|
channel | waba, facebook, or instagram |
source_id | Ad or post ID |
source_type | Source type |
source_url | Link to the ad |
headline | Ad headline |
body | Ad body |
media_type | Ad media type |
Example ad data
This is what the ad field looks like in a request when the customer messages you from a Click-to-WhatsApp ad.
"ad": {
"channel": "waba",
"source_id": "120211234567890123",
"source_type": "ad",
"source_url": "https://fb.me/1aBcDeFgH",
"headline": "Nationwide delivery",
"body": "Message us on WhatsApp for a quote",
"media_type": "image"
}
When the ad field is empty
The ad field is populated only in the message the customer sends from the ad. It is null in subsequent messages in the conversation. Save the data in your workflow if your AI needs it later.
When a customer contacts you on WhatsApp through a QR code, there is no ad field.
A click on a Messenger or Instagram ad in an existing conversation is not passed along unless a new message is sent.
Related questions
What fields the workflow receives · How to connect an AI agent through n8n · WhatsApp ad tracking in Kommo
Get in touch
We reply during business hours.
New to AnyLinga?
Try it yourself, or we'll set it up for you when you pay for the first month.