# Facebook Retargeting

### Step 1 - Add Facebook Pixel&#x20;

Add the Facebook Pixel code to your webpages where the chatbot is live. To learn how to add the Facebook Pixel code on your website - [please refer to this link](https://www.facebook.com/business/help/964258670337005?id=1205376682832142).

### Step 2 - Add Custom Events to your Chatbot Flow

In your chatbot flow, at any stage, you can push a custom event to your Facebook Audience. And then you can use these events to create a Custom Audience that you can retarget on Facebook.&#x20;

#### How to add Custom Events in Chat Flow

* Add a [Client Javascript](/ai-builder/nodes/additional/client-javascript.md) Node in the chat flow.
* You can track custom events by calling the pixel's `fbq('trackCustom')` function, with your custom event name, and (optionally) a JSON object as its parameters. For more details refer to [Facebook's Documentation](https://developers.facebook.com/docs/facebook-pixel/implementation/conversion-tracking#custom-events).

```javascript
fbq('trackCustom', 'ShareDiscount', {promotion: 'share_discount_10%'});
```

**Example:-**

Suppose an insurance company has this kind of a chatflow

![](/files/-MA0SHHZwVeEu5MFiBEJ)

After the selection, a custom event can be pushed to Facebook such as&#x20;

```bash
fbq('trackCustom', 'Health-Insurance', {gender: 'Female'});
```

So, now you can create a custom audience who is interested in Health Insurance and is a female.&#x20;

{% hint style="info" %}
&#x20;This way you can create a **highly enriched customized audience** for retargeting.&#x20;
{% endhint %}

### Step 3 - Create a Custom Audience

Follow [Facebook's guide](https://www.facebook.com/business/help/666509013483225?helpref=typeahead_suggestions\&sr=1\&query=%20custom%20audience%20from%20events) on how to create a Custom Audience using Website Events.&#x20;


---

# 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.intelliticks.com/growth-hacks/facebook-retargeting.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.
