Fixing Thinkific’s Facebook Conversion Pixel

If you're using Thinkific to track your Facebook ad spend then you need to read this.

I've reached a level now where we are doing 2 things that let Facebook optimise our campaigns using it's own data – it's what everyone selling online should be aiming for.

  1. Targeting an audience which is a lookalike of our own buyers, with Lifetime Value data attached – this means FB knows who our best buyers are and can find more of them
  2. Optimising that campaign for Purchases, not just click or leads

So with that in mind there are a few places where Thinkific falls ¬†down that need to be tended to…

Firstly, don't rely on the integration in the “Integrations” menu. All that does is track page views.

What you'll need is to add conversion code with the value of your sales to the block in Advanced Settings > Order Tracking Code

<!-- Facebook Pixel Code -->
 <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','//connect.facebook.net/en_US/fbevents.js');
 fbq('init', '1234567890');
 fbq('track', 'Purchase', {value: '{{ total_price }}', currency: 'USD'});
 }
 </script>
 <noscript><img height="1" width="1" style="display:none"
 src="https://www.facebook.com/tr?id=1234567890&ev=PageView&noscript=1"
 /></noscript>
 <!-- End Facebook Pixel Code -->

But we're not done yet!

The critical line is this one:
fbq(‘track', ‘Purchase', {value: ‘{{ total_price }}', currency: ‘USD'});

{{ total_price }} is a snippet of Thinkific code that will put the actual purchase price into your pixel – feeding it back to Facebooks' Reports

Unfortunately this is fired even when you sign up for a free trial, so your Facebook reports will be full of “Purchases” with no value:

To fix this we need to tweak the Facebook pixel code a bit so that if the purchase isn't actually a purchase but a free trial signup, we record it as a Registration instead.

This just needs a little if / else magic…

<!-- Facebook Pixel Code - solves issue of free trials being seen as purchases -->
<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','//connect.facebook.net/en_US/fbevents.js');
fbq('init', '1234567890');
var thinkprice = {{ total_price }};
if (thinkprice > 0) {
fbq('track', 'Purchase', {value: '{{ total_price }}', currency: 'USD'});
} else {
fbq('track', 'CompleteRegistration');
}
</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=1234567890&ev=PageView&noscript=1"
/></noscript>
<!-- End Facebook Pixel Code -->

Now our reports look a lot cleaner

Only the purchases with actual value show up now.

Now, the real importance of this is how Facebook currently optimises for purchases.

It only uses the number of sales, not their value, so all those free trials will register as sales and in the long term you'll be optimising for freebie hunters, not buyers.

Fix this up and your optimisations will run a lot more smoothly

I have it from reliable sources that Facebook is rolling out an optimisation based on the purchase value rather than number of purchases, this could mean advertising that runs almost on autopilot!

Stephen Pratley

I've spent 20 years building huge email lists and prospect databases for the UK's biggest retail, media and technology brands. Now you can learn the same tactics for your own business.

"5 Campaigns to Set & Forget"

Enter your best email below for instant access to your free ebook.

Comments