XCloak Logo XCloak
← Back to articles

How to Launch Cloaking in Facebook Ads, Google Ads, and TikTok Using PHP Integration: The Complete XCloak Guide

31 Oct 2026 | 4 views | Rating: 5.00
How to Launch Cloaking in Facebook Ads, Google Ads, and TikTok Using PHP Integration: The Complete XCloak Guide

When working with paid traffic in Facebook Ads, Google Ads, and TikTok Ads, a media buyer's key task is to separate visitor flows: show reviewing algorithms and moderators a legal website (White Page), and direct the target audience to the offer page (Offer Page) without losing loading speed or creating redirect chains.


PHP Integration (index.php) is the classic and most reliable cloaking method, where filtering occurs directly on your domain and hosting without changing the URL in the browser address bar.


In this guide, we will break down step-by-step how to generate a safe White Page from scratch, set up a flow in XCloak, upload the index.php script to your hosting, and launch a campaign in Facebook, Google, or TikTok.




Why Is the PHP Integration Method Best Suited for FB, Google, and TikTok?

Unlike regular redirects, PHP integration using the «Preload» (curl) method or a local site.html file features:


  1. No domain change for moderators: the ad network bot opens your https://example.com and receives the white page code with a 200 OK response status without any 301/302 redirects.

  2. Sub-millisecond engine response: the index.php script requests XCloak, which checks IPs against databases (ASN, providers, data centers, connection types), User-Agent, and digital fingerprints in fractions of a millisecond.

  3. Spy service protection: ad scrapers (AdHeart, Pipiads, Tyver, etc.) using server proxies and VPNs see exclusively your White Page.



Step 1. Domain, Hosting, and White Page Preparation

To work with the PHP integration method, you will need:


  • Any shared hosting or VPS supporting PHP 7.4 / 8.0+ with the cURL module enabled.

  • A domain with an active SSL certificate (https://).

  • A multi-page or niche-relevant White Page (white page for moderation).

How to Create a White Page in 1 Minute Inside XCloak

If you don't have a ready-made white page, you can generate one directly in your dashboard using the built-in AI-powered White Page Generator:


  1. Go to the «White Pages» section in the left menu and click «Generate White Page».

  2. Fill in the basic parameters:

    • White Page Name — an internal name for your convenience.

    • Vertical & Topic — select a niche closest to your creative (finance, health, IT, gaming, marketing, etc.).

    • Generation Language — specify the language of your target GEO.

    • Target Domain — specify your domain (the AI will automatically include it in the Privacy Policy, Terms of Service, and contacts).

  3. Click «Generate White Page». After a minute, the status will change to «Ready».



Tip: Do not download the archive right now — first create a flow in Step 2 to download the White Page with the built-in cloaking script already included with a single click.



Step 2. Flow Creation and Configuration in XCloak

Go to the «Flows» section in the left menu and click «Create Flow». Setup consists of 4 logical blocks (you can switch between «Step-by-Step Wizard» and «Expanded View» modes).


  • 1. General & Offers

  • Flow Name: specify a clear name, for example FB -> Nutra PL or Google -> Crypto DE.

  • White Page (page for bots and moderators):

    • In the URL field, specify site.html (if uploading the white page locally to the same folder as index.php) or the full link to an external site.

    • In the Display Method / Action field, select «Preload». In this mode, the white page content opens without changing the URL.

  • Offer Page (page for target users):

    • Select mode: «Single Offer» or «A/B Split Testing» (if you want to distribute traffic between 2–3 pre-landers or offers by percentage weights).

    • Specify the link to your target landing page or tracker.

    • Display Method: select «Preload» (if the landing page is local or you need to hide the URL) or «Redirect» (classic transition to an affiliate link).


2. Targeting (GEO & Devices)

In the «2. Targeting» tab, set your ad campaign parameters:


  • Countries: select «Allow» mode and specify only the countries targeted in your ad account (e.g., Poland PL, Germany DE, Brazil BR).

  • Device Type and OS: if driving mobile traffic only (e.g., In-App or TikTok Android/iOS), select Mobile, and under operating systems check Android and iOS.

  • Languages, Browsers, Timezones, and Connection Types: if necessary, limit connection types (e.g., exclude corporate networks and satellite internet).



Important: Each targeting block must have at least one selected value (set to «Select All» by default). Unchecking all boxes and leaving a field empty will block all traffic.

3. Filters & Protection (Recommendations for Facebook, Google, and TikTok)

In the «3. Filters & Protection» tab, enable bot detection modules. Below is a table of optimal settings for each traffic source:


XCloak Filter Parameter

Facebook Ads

Google Ads

TikTok Ads

Explanation

Cloaking

On

On

On

Main filtering switch. If turned off, all traffic goes to the White Page.

Black IP

On

On

On

Blocks server subnets of Meta, Google, ByteDance moderators, and web crawlers.

Block VPN / Proxy

On

On

On

Blocks data centers, commercial VPNs, and residential proxies of spy services.

Block IPv6

Optional

Recommended

Optional

In some GEOs, bots use IPv6 pools; enable if in doubt.

Empty ISP

On

On

On

Blocks anonymous connections without an identifiable ISP.

Empty Referer

On

On

On

Blocks direct link visits in the browser (when links are copied manually or opened by bots without a referer).

Pass First X Clicks

5–15

10–20

5–10

The first N clicks after launch are guaranteed to see the White Page (protection during initial auto-moderation).

Daily Clicks Limit per IP

2–3

2–3

2–3

Protects the offer from manual competitor clicks or re-inspections.

GET Parameter Filtering

fbclid or custom UTM

gclid or custom UTM

ttclid or custom UTM

Allows access to the Offer Page only for visits containing a real ad parameter.


4. Launch & Code

In the «4. Launch & Code» tab:


  • Set the flow status to «Active».

  • In the «IP Whitelist» field, you can add your personal IP address to check how the Offer Page opens from your computer.

  • Click «Save and Launch».



Step 3. Downloading the index.php Script and Uploading to Hosting

There are two ways to deploy PHP integration on your domain:

Method A (Fastest): Download a ready-made White Page archive with pre-embedded index.php

  1. Go to the «White Pages» section in your XCloak dashboard.

  2. Next to the created white page, click «With Integration».

  3. In the modal window, select your flow from the drop-down list and click «Download ZIP with Integration».

  4. The system will automatically rename the white page main file to site.html, add the configured index.php file to the archive, and set the White Page path in the flow to site.html using the «Preload» method.

  5. Upload the ZIP archive to your domain root directory on your hosting (e.g., public_html or /var/www/domain.com) and extract it.


Method B (If using your own third-party White Page):

  1. Go to the Flows section and click the «Integration» icon (download symbol) in the corresponding flow row.

  2. In the «Method 1 — PHP Integration» block, click «Download index.php».

  3. On your hosting, rename your main white page file from index.html (or index.php) to site.html (and verify that site.html is specified as the White Page URL in the flow settings).

  4. Upload the downloaded index.php file from XCloak to your root directory alongside site.html.




Step 4. Setting Up S2S Postback (Tracking Leads and ROI)

To track clicks as well as real leads, sales, CR, and revenue for each flow:

Open the «Integration» window for your flow in the «Flows» section.

  1. Open the “Integration” window for your flow in the “Flows” section

  2. Scroll down to the «Postback — S2S Postback (Conversion Tracking)» block and copy the URL


https://api.xcloak.org/api/v1/postback?click_id={click_id}&payout={payout}&status={status}


  1. Pass the {click_id} macro in your offer link (in the flow settings, XCloak automatically passes click_id and incoming UTM parameters to the Offer Page) and paste the S2S Postback into your affiliate network or tracker (Keitaro, Binom, etc.).




Step 5. Testing Before Launching Ads

Before inserting the link into your Facebook, Google, or TikTok ad account, perform a quick verification:


  1. Open your domain https://your-domain.com directly in a browser (in Incognito mode without parameters). Since the «Empty Referer» filter (or GET parameter / GEO filter) triggers, you should see your White Page without redirects.

  2. Go to XCloak Dashboard -> «Clicks» section.

  3. You will see your test visit in the real-time logs table. Click the «Inspector» button to the right of the click to open a detailed card showing your IP, provider (ISP), device, headers, and the exact reason why the visit was routed to the White Page.



Now your link is fully ready for traffic! Insert your domain address with the required UTM parameters into your ad campaign.



XCloak Discount Promo Code for Readers

Start filtering traffic at maximum speed with the sub-millisecond XCloak engine:


Promo code: XCLOAK30
Provides a discount when paying for any plan in the user dashboard.


How to activate the promo code:


  1. Register in XCloak and go to the «Pricing» section.

  2. Select a suitable subscription plan and click «Select Plan».

  3. On the checkout page, click «I have a promo code», enter the code, and complete payment via balance or cryptocurrency.



Frequently Asked Questions (FAQ)

Does the PHP script slow down site loading during checks in Google Ads or Facebook?

No. The response time of the filtering server is less than 1–5 ms, so the page loads instantly.

What should I do if the ad account is still under review and I want to play it safe?

You can either set the «Pass First X Clicks» parameter in the flow settings (for example, 15), or temporarily switch the flow status to «Pause» (or turn off the «Cloaking» toggle) — then 100% of traffic will be directed to the White Page. As soon as the ad passes moderation, enable the flow with a single click without making any changes on your hosting.


Comments [0]

Please log in or register to leave a comment.

Be the first to leave a comment