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:

<title>Thank You</title>

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


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.

    10 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.

      • Mark

        Hey Sav!
        Have you had any luck cloaking the Pixel? Cheers.

    • Shageldi

      Hey man. thanks for the article.
      Can we have one thank_you page for multiple landing pages on same domain?
      for example:

      • nick

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

    • Casey

      Executed the method but FB analytics is still showing my lander as the source URL.

      I also tried to use a bit.ly link to further mask as the source URL, but didn’t work.

      Can I PM you a video of my setup and get some feedback?

      Thanks in advance Nick!

      • nick


        What do you want the source URL to be? This method is supposed to make it so your lander URL fires the pixel, so then it looks like the event is coming from your domain used in your ads and not from some random domain that could be flagged.

        If you want the Advertiser’s URL to fire the event then you don’t need to use this method at all.


    • Grunt

      Great info, thanks.. I’ve had a look but can’t find any info on whether you can add value to the img pixel
      I tried &noscript=1&ev=Purchase&value=10.00&currency=gbp” but doesn’t seem to work.

Leave a Reply

Your email address will not be published.