Expand performance marketing, reach new audiences, and grow your business

How to Dynamically Change the Content of a PHP Website

KClient PHP (formerly Click API v3) is one of the Keitaro integration methods that allows you to connect to remote resources via PHP code and dynamically substitute the content of the website without visible redirects. This solution can be used with any remote sites where php code can be inserted as well as while importing mobile applications into the webview.

Creating a campaign in Keitaro​

As an example, let's set up our campaign so that bots stay on our site, and live visitors get to the targeted offer.


We created two streams. The first stream is Forced with the Do Nothing action and the BOT filter. That will allow us to leave bots on the site.

The second stream will be used for live visitors. In this stream we can add a redirect link or an offer and a landing page, it all depends on your traffic funnel.

These settings allow us to leave bots on the site and redirect other visitors where we need them to.

Setting up the integration​

Next, go to the integration tab in the campaign and select KClient PHP:


Pay attention to the Campaign link field on the screenshot above.

For the correct work of the integration, a domain added to Keitaro is needed. Next, make sure you use the same protocol in Keitaro and on your website you are adding the integration to. E.g., if the domain in Keitaro is used with the HTTPS-protocol, then your website address should be used with HTTPS as well.

Now connect to the hosting with your website via SFTP. Find the index file of your website, open it in any editor.

Return to Keitaro, to your integration tab with KClient PHP, and copy the code for the landing page:


Insert the code to the very beginning of an index file, change the extension of an index to .php and save the changes:


IMPORTANT! Make sure that you save the index.php file in UTF-8 without BOM encoding.

After saving the changes return to Keitaro and download the kclient.php file at the bottom of integration page:


Download this file and upload it to your hosting to the directory with the index.php file.

Done! We’ve just integrated our Keitaro campaign to your website. Now all bots will stay on a website while real visitors will get to the offer.

In case you have any questions left feel free to reach out, our support team will be happy to help out. You can also find more information on our official thread! 🚀
About author

Keitaro Tracker is the gold standard tracker to optimize and scale your advertising.

Reduce costs for unprofitable advertising campaigns and focus on generating profit.


There are no comments to display.

Article information

Last update

More in Tools

Share this article