# Facebook Pixel

You can integrate your Facebook Pixel with ReferralHero to understand your user behaviour and traffic. A Facebook pixel collects data about people who visit or sign up to your campaign, so that you can more effectively plan your ad campaigns to find new customers.

### Add a Facebook pixel ID to your campaign

1. Grab your Facebook Pixel ID from your [Facebook Ads Manager](https://www.facebook.com/ads/manager/pixel/facebook_pixel)
2. Go to your campaign dashboard > *Edit campaign > Integrations > Facebook Pixel*
3. Toggle **Enable Facebook Pixel** and enter the Pixel ID
4. Save the changes

   <figure><img src="https://363135598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsuqexOLPOWiUrWg_Ko%2Fuploads%2F6RLCUOwRiJn5RzTTX0j4%2Fimage.png?alt=media&#x26;token=5e79ac3f-8798-4764-b23f-29dcccad2bc2" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
After you add the pixel to your campaign, then you can make sure that it's working by using Facebook Ads Manager. Learn about [how to tell if your Facebook pixel is working](https://www.facebook.com/business/help/218844828315224) from the Facebook Help Center.
{% endhint %}

{% hint style="warning" %}
**NOTE**: If you've recently added a Facebook pixel to your online store, then you need to wait for customer activity before you'll see any data in Facebook Ads Manager.
{% endhint %}

### Facebook Pixel Events

ReferralHero sends 3 standard events to Facebook:

* **PageView**\
  When a user visits your campaign.
* **Lead**\
  When a person signs up to your campaign.
* **CompleteRegistration**\
  When a person verifies their email address.

Note that if the Email confirmation is enabled that number of "Lead" events might be higher than the number of  "CompleteRegistration" events due to some people not confirming their email address.

### Trigger Facebook Pixel Manually

To trigger the Facebook Tracking Pixel manually, just use the **afterSuccess** callback in the Configuration file and choose which events you want to send.

```markup
<script type="text/javascript">
  window.RHConfig = {
    callbacks: {
      afterSuccess: function(output) {
        if (output.response == "subscriber_created") {
          fbq('track', 'signup');
        }
      }
    }
  }
</script>
```
