How to Cloak Your Facebook Pixel

Facebook Ads is one of the higher quality traffic sources, particularly for affiliate offers. The only problem is that Facebook is pretty ban happy - meaning they will straight up ban your account even if you follow all of their advertising policies.

One of the best parts about Facebook is that you can get their algorithm to bid for conversions if you use the conversion objective campaign. However, to take advantage of this feature you usually need to have a thank you page with your conversion event installed.

This isn't exactly easy if your working with an affiliate network where the thank you page is actually owned by the offer owner.

Because of this, most affiliates will just simply bid for link clicks, or clicks on their call to action button. While this can work profitably, you're not giving Facebook's algorithm the data it needs to send you the traffic you want - converters.

Today I'm going to show you an advanced tactic you can deploy into your campaigns so you can actually take advantage of the conversion objective campaigns. To do this, you must cloak your Facebook pixel.

Why Do You Need to Cloak Your Facebook Pixel?

As said above, you can't exactly place your conversion event on the thank you page of an affiliate offer.

If you 'cloak' your Facebook Pixel then you can fire the conversion from the same domain you're using in your ads. This can help hide the fact that you're promoting affiliate offers and keep your account live for much longer because Facebook won't become suspicious of the domain mismatching.

Cloaking the Facebook Pixel in 2 Steps

The process to cloak your Facebook Pixel is actually really simple.

You first need to make simple HTML page that looks like this:

HTML code
HTML code

Where it says PIXEL-ID-REPLACE you replace it with your Facebook Pixel ID, which is usually a string of numbers.

Where it says PIXEL-EVENT-REPLACE you will replace it with the name of the event, for example "Lead".

Upload the file with the code above to your server as something like thank-you.html.

Whenever the above page is loaded it will fire your conversion event. Instead of the entire Facebook Pixel code, we're just using the noscript part of it in an img tag.

The 2nd step to finish cloaking your Facebook Pixel is to add iFrame code to your affiliate network. I suggest consulting with your affiliate manger about this, but basically you want to upload the following code:

iFrame HTML code
iFrame HTML code

If you upload this correctly into your affiliate network, whenever a conversion happens this iFrame will load, which in turn will fire your Facebook Pixel conversion event from the same domain you used in your ads.

Facebook Pixel helper
Facebook Pixel helper

Notes About Cloaking Your Facebook Pixel

Cloaking your Facebook pixel is not guaranteed to not get you banned. Facebook is Facebook, and they could still ban you.

Most advertisers use the Javascript implementation of the Facebook Pixel, so if anything, this could bring red flags to Facebook.

However, I've never had issues directly related to implementing the pixel like this.

Nick Lenihan the Affiliate Marketing Wizard

Nick Lenihan

Performance marketer, consultant, and affiliate marketing wizard. Hire me or subscribe to my YouTube channel.