# Facebook Ads Integration

Your Xenioo chatbot can be easily activated by a Facebook Ads integration by simply customizing the payload JSON. By connecting directly to a specific behavior, you can have your Facebook Advertising start a very specific section of your chatbot when interacted.\
\
To use this feature, simply copy and paste the following JSON inside the Facebook Ads custom JSON. Just replace "title", "image-url", "subtitle" and "payload" with your correct values and you're ready to go.

```
{
    "message": {
        "attachment": {
            "type": "template",
            "payload": {
                "template_type": "generic",
                "elements": [
                    {
                        "title": "ANY TITLE",
                        "image_url": "ANY IMAGE URL>",
                        "subtitle": "ANY SUBTITLE",
                        "buttons": [
                            {
                                "type": "postback",
                                "title": "CALL TO ACTION",
                                "payload": "<PUT HERE THE BEHAVIOUR API TOKEN>::"
                            }
                        ]
                    }
                ]
            }
        }
    },
    "user_edit": true
}
```

**Remember: the payload token must always end with 2 (two) colon.** The behavior API token can be easily copy/pasted directly from the [behavior details panel](/basic-concepts/the-chatbot-designer/behaviours_concepts.md).

![](/files/-LdhYjUBxyaf5mqf3ITd)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.xenioo.com/basic-concepts/publishing/channels/facebook/facebook-ads-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
