Custom Facebook Pixel Handling

In the vast majority of cases, using Fundraise Up's built-in tools to send events to Facebook Pixels will better handle your needs. However, if there's extenuating circumstances, you can set up a custom flow of events outside of the standard tools.

Custom Integration

If you'd like to fully customize the Facebook implementation (rather than using our native functionality for Facebook Pixel and Conversions API article), please disable the native Facebook Marketing Pixel feature in your dashboard:

Note: The Facebook Conversions API feature in Fundraise Up cannot be used if you are using custom Facebook Pixel event mapping. If you do chose to use the Facebook Conversions API tools in the Marketing Pixels settings screen, you will have duplicate data as that Conversions API tool sends standard Facebook Events.

Getting Started

The Facebook pixel is a snippet of JavaScript code that allows you to track visitor activity on your website. It works by loading a small library of functions which you can use whenever a site visitor takes an action (called an event) that you want to track (called a conversion)

Read more at https://developers.facebook.com/docs/facebook-pixel/implementation

Base Code

Before you can install the pixel, you will need your pixel's base code, which you can find in the Ads Manager > Events Manager. If you have not created a pixel, follow these instructions to create one — all you will need is the pixel's base code.

The base pixel code contains your pixel's ID in two places and looks like this:

Checkout Open

Fundraise Up's "checkoutOpen" event maps nicely with Facebook's "InitiateCheckout" standard event.

<script>
FundraiseUp.on('checkoutOpen', function(details) {

fbq('track', 'InitiateCheckout', {
content_name: details.campaign.name,
content_category: 'Fundraise Up',
content_type: 'product'
});

});
</script>

Donation Completed

Fundraise Up's "donationComplete" event can be mapped to Facebook's "Purchase"  standard event for one-time donations and "Subscribe" for recurring donations.  Additionally, we recommend firing the "Donate" standard Facebook event.  Note that you may pass additional  custom variables to Facebook including donor's personal information, designation, etc.

<script>
FundraiseUp.on('donationComplete', function(details) {

var data = {
content_category: 'Fundraise Up',
content_name: details.campaign.name,
content_ids: [details.donation.recurring ? 'Monthly Donation' : 'One-time Donation'],
content_type: 'product',
contents: [{'id': details.donation.id, 'quantity': 1 }],
value: details.donation.amount,
currency: details.donation.currency,
predicted_ltv: details.donation.recurring ? details.donation.amount * 12 : details.donation.amount
};

/*Adjust it if you prefer only Purchase events */
if ( details.donation.recurring ) {
fbq('track', 'Purchase', data);
} else {
fbq('track', 'Subscribe', data);
}

fbq('track', 'Donate', data );

});
</script>