Donorbox allows us to run scripts after the donation is successfully made. We can make use of this feature to track the donations on Facebook Pixel account.
1. Click on the edit symbol under the campaign to which the tracking script is being added:
2. Select the edit icon under Technical:
3. Add the below tracking script to the After donation tracking codes field as indicated in the screenshot that follows. Make sure to replace 'XXXXXXXXX' with your Facebook Pixel ID.
<script>
!function(f,b,e,v,n,t,s) {if(f.fbq)return;n=f.fbq=function(){n.callMethod? n.callMethod.apply(n,arguments):n.queue.push(arguments)}; if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; n.queue=[];t=b.createElement(e);t.async=!0; t.src=v;s=b.getElementsByTagName(e)[0]; s.parentNode.insertBefore(t,s)}(window, document,'script', 'https://connect.facebook.net/en_US/fbevents.js'); fbq('init', 'XXXXXXXXX'); fbq('track', 'Purchase', { value: DONORBOX.donation.amount, currency: DONORBOX.donation.currency });
</script>
Note: The above example script tracks the donations as "Purchase" event on your Facebook Pixel account. Feel free to include any additional data that you may want to track along with the event.
For more details on what additional data can be included, please refer https://developers.facebook.com/docs/meta-pixel/implementation/conversion-tracking/#object-properites.
For details about what information is available for tracking, please refer https://donorbox.zendesk.com/hc/en-us/articles/4403843443348-What-is-the-information-available-for-tracking-in-the-After-donation-tracking-code-field
Comments
0 comments
Article is closed for comments.