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>
<head>
<title>Thank You</title>
</head>
<body>

<img src="https://www.facebook.com/tr?id=PIXEL-ID-REPLACE&noscript=1&ev=PIXEL-EVENT-REPLACE" />

</body>
</html>

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 src="http://yourdomain.com/thank-you.html" width="1" height="1" frameborder="0" style="display: none;" frameborder="0" scrolling="no"></iframe>

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.

cloak your facebook pixel for CPA affiliate campaigns

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.


    6 replies to "How to Cloak Your Facebook Pixel"

    • Tony stark

      Hey man that’s a good article do you have any advice on how to get more Facebook Ad accounts if one gets banned?

      • nick

        I’m certainly not an expert at getting new Facebook accounts. If you use the business manager and spend some money, they will eventually allow you to have 800+ accounts under that business manager. If one account get banned it won’t necessarily mean your other accounts under the same business manager get banned.

    • Sav

      Hey Nick, thanks for this article. I just tested it and the pixel apparently fires, however, the “Pixel Location” URL is empty (I checked also on Facebook in the Ads Manager Pixel page and the URL is not showing up there neither). So I’m not sure it’s working properly. Is this method still working properly for you?

      • nick

        I’m not sure to be honest. You’d have to run some traffic to test it out. I don’t currently have “cloaked” FB campaigns running so I can’t help there.

    • Shageldi

      Hey man. thanks for the article.
      Can we have one thank_you page for multiple landing pages on same domain?
      for example:
      http://www.mydomai.com/lander1/index.html
      http://www.mydomai.com/lander2/index.html
      http://www.mydomai.com/lander3/index.html
      http://www.mydomai.com/thank-you.html

      • nick

        Yeah, of course, you can. I do that lots.

Leave a Reply

Your email address will not be published.