(window.webpackJsonp=window.webpackJsonp||[]).push([[28],{1407:function(t,e,s){"use strict";s.r(e);var a=s(8),n=Object(a.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"kclient-php"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#kclient-php"}},[t._v("#")]),t._v(" KClient PHP")]),t._v(" "),a("p",[a("Badge",{attrs:{type:"tip",text:"advanced",vertical:"top"}}),t._v(" "),a("Badge",{attrs:{type:"tip",text:"expert",vertical:"top"}}),t._v(" "),a("Badge",{attrs:{type:"tip",text:"team",vertical:"top"}}),t._v(" "),a("Badge",{attrs:{type:"tip",text:"enterprise",vertical:"top"}})],1),t._v(" "),a("p",[t._v("KClient PHP is the traffic tracking, and target-action checking method on the third-party sites. It connects Keitaro to remote resources via PHP—code. When you click on a site link, it performs actions and settings of the campaign which you connect to the site. Optionally, it performs a dynamic content spoofing without the visible redirect.")]),t._v(" "),a("p",[t._v("The method is suitable for any remote sites with the possibility to place php—code or to import mobile applications into webview.")]),t._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),a("p",[t._v("Important")]),t._v(" "),a("ol",[a("li",[a("p",[t._v("KClient PHP is only attached to the sites that are hosted on the third-party hosts or servers. Do not add KClient PHP code to a site or webview that is loaded as a "),a("RouterLink",{attrs:{to:"/en/landing-pages-and-offers/landing-page-local.html"}},[t._v("local landing page or offer")]),t._v(" in Keitaro.")],1)]),t._v(" "),a("li",[a("p",[t._v("When working with KClient PHP, the campaign tracking link is a link to the site, where the tracking code from the Keitaro campaign is added. The traffic path on working with KClient PHP: a site with a tracking code -> Keitaro -> execution actions, and settings of the campaign, from which the tracking code is taken.")])]),t._v(" "),a("li",[a("p",[t._v("The file for adding the integration code must have "),a("code",[t._v("php")]),t._v(" extension.")])]),t._v(" "),a("li",[a("p",[t._v("The domain parked to Keitaro and the domain of the site, where you put the tracking code, must be two different domains with an active SSL-certificate (working on HTTPS).")])]),t._v(" "),a("li",[a("p",[t._v("Do not add a link to the website, where the KClient PHP code is installed, in the campaign tracker's flow. For example, if you are placing the KClient PHP code on mysite.com, you must not add the mysite.com link to the campaign tracker's flow.")])])])]),t._v(" "),a("h2",{attrs:{id:"connection-and-setup"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#connection-and-setup"}},[t._v("#")]),t._v(" Connection and setup")]),t._v(" "),a("ol",[a("li",[t._v("Firstly, you must "),a("RouterLink",{attrs:{to:"/en/campaigns-and-streams/creating-campaign.html"}},[t._v("create a campaign")]),t._v(" in Keitaro. "),a("br")],1)]),t._v(" "),a("p",[t._v("The example of campaign setup: create two flows. The first flow with the "),a("code",[t._v("Do nothing")]),t._v(" action and the BOT-Yes filter. This flow accepts bots and "),a("code",[t._v("Do nothing")]),t._v(" action leaves them on the site (bot page), where KClient PHP is connected.")]),t._v(" "),a("p",[t._v("The second flow is created with the necessary filters for target traffic. Target offers are added to the flow to collect conversions")]),t._v(" "),a("p",[a("img",{attrs:{src:s(349),alt:"",loading:"lazy"}})]),t._v(" "),a("p",[t._v("It is acceptable to add any type of flows, landing pages, offers, filters, etc. It all depends on your traffic funnel.")]),a("p"),t._v(" "),a("ol",{attrs:{start:"2"}},[a("li",[t._v("Getting a Tracking Code")])]),t._v(" "),a("p",[t._v("Select a domain with HTTPS on the Campaign Settings tab. Go to the Tracking and copy the tracking code (landing code):")]),t._v(" "),a("p",[a("img",{attrs:{src:s(439),alt:"",loading:"lazy"}})]),t._v(" "),a("ol",{attrs:{start:"3"}},[a("li",[t._v("Connect via SFTP.")])]),t._v(" "),a("YouTube-Video",{attrs:{code:"YPQQ1i-Y9OM"}}),t._v(" "),a("p",[t._v("Go to the site directory")]),t._v(" "),a("p",[a("img",{attrs:{src:s(440),alt:"",loading:"lazy"}})]),t._v(" "),a("p",[t._v("Insert the tracking code in "),a("code",[t._v("index.php")]),t._v(" of the site, copied from the campaign. Starting from the first line (before "),a("code",[t._v("<html>")]),t._v(" and DOCTYPE),")]),t._v(" "),a("p",[a("img",{attrs:{src:s(441),alt:"",loading:"lazy"}})]),t._v(" "),a("p",[t._v("::: Check the UTF-8 encoding.")]),t._v(" "),a("p",[t._v("Make sure the site index.php is UTF-8 encoded, not BOM.")]),t._v(" "),a("p",[t._v("Use any text editor:")]),t._v(" "),a("p",[a("img",{attrs:{src:s(442),alt:"",loading:"lazy"}}),t._v("\n:::")]),t._v(" "),a("ol",{attrs:{start:"4"}},[a("li",[t._v("Downloading the kclient.php file.")])]),t._v(" "),a("p",[t._v("The "),a("code",[t._v("kclient.php")]),t._v(" file is the client, which the tracking code refers to and which calls the tracker's campaign.")]),t._v(" "),a("p",[t._v("Download the "),a("code",[t._v("kclient.php")]),t._v(" file from the "),a("strong",[t._v("Tracking")]),t._v(" tab")]),t._v(" "),a("p",[a("img",{attrs:{src:s(443),alt:"",loading:"lazy"}})]),t._v(" "),a("p",[t._v("Upload the file in the same directory with index.php. Load the kclient.php file with "),a("code",[t._v("kclient.php")]),t._v(" name. If you upload a file with a different name, be sure to rename it to an identical one in the tracking code.")]),t._v(" "),a("p",[t._v("The main stage of setting up is now completed. Now, when you go to the home page of the website, in the index.php you added the tracking code for, the actions from the Keitaro campaign running where the tracking code was copied.")]),t._v(" "),a("h2",{attrs:{id:"testing"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#testing"}},[t._v("#")]),t._v(" Testing")]),t._v(" "),a("p",[t._v("Open the site, check "),a("RouterLink",{attrs:{to:"/en/maintenance/logs.html#traffic-log"}},[t._v("traffic log")]),t._v(". The log shows the click and the action selected for the click in the flow (Redirect to offer, Do nothing, etc.)")],1),t._v(" "),a("p",[a("img",{attrs:{src:s(444),alt:"",loading:"lazy"}})]),t._v(" "),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[t._v("TIP")]),t._v(" "),a("p",[t._v("If "),a("RouterLink",{attrs:{to:"/en/maintenance/logs.html#traffic-log"}},[t._v("traffic log")]),t._v(" is turned off, you must turn it on and open the website again.")],1)]),t._v(" "),a("p",[t._v("If there are no clicks in the traffic log, go to the Debugging section below on this page.")]),t._v(" "),a("h2",{attrs:{id:"reсeiving-recording-and-passing-further-url-parameters-placeholders-from-the-site"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#reсeiving-recording-and-passing-further-url-parameters-placeholders-from-the-site"}},[t._v("#")]),t._v(" Reсeiving, recording and passing further URL parameters (placeholders) from the site")]),t._v(" "),a("p",[a("a",{attrs:{href:"https://youtu.be/X2xnS9CAOH0?t=653",target:"_blank",rel:"noopener noreferrer"}},[t._v("Step-by-step instructions using KClient PHP as an example"),a("OutboundLink")],1),t._v(". Use EN subtitles, please.")]),t._v(" "),a("h2",{attrs:{id:"sending-postbacks"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#sending-postbacks"}},[t._v("#")]),t._v(" Sending postbacks")]),t._v(" "),a("ol",[a("li",[t._v("Add the following code to the index.php")])]),t._v(" "),a("div",{staticClass:"language-php line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$_SESSION")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'subid'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$client")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getSubid")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br")])]),a("p",[t._v("The code will write the Keitaro's click ID to the session.")]),t._v(" "),a("ol",{attrs:{start:"2"}},[a("li",[t._v('On the page that opens with the target action (the "Thank you" page), add the following code:')])]),t._v(" "),a("div",{staticClass:"language-php line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("session_start")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("var_dump")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$_SESSION")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$url")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'POSTBACK_URL/postback?payout=100&status=sale&subid='")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("urlencode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$_SESSION")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'subid'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("file_get_contents")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$url")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br"),a("span",{staticClass:"line-number"},[t._v("2")]),a("br"),a("span",{staticClass:"line-number"},[t._v("3")]),a("br"),a("span",{staticClass:"line-number"},[t._v("4")]),a("br")])]),a("p",[t._v("Go to the Maintenance—Postback URL section in Keitaro. Copy the link up to "),a("code",[t._v("/postback")]),t._v(". Replace this part of the link.")]),t._v(" "),a("p",[t._v("The form sends the postback to the Postback URL.")]),t._v(" "),a("h2",{attrs:{id:"transition-to-offer-by-click-button-on-a-site"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#transition-to-offer-by-click-button-on-a-site"}},[t._v("#")]),t._v(" Transition to offer by click button on a site")]),t._v(" "),a("p",[t._v("To navigate to a landing page by clicking a button on the site, follow the instructions:")]),t._v(" "),a("ol",[a("li",[a("p",[t._v("Create a flow in a Keitaro campaign, the Landings or Offers scheme. Add a targeted offer to the flow;")])]),t._v(" "),a("li",[a("p",[t._v("Comment out the line of code "),a("code",[t._v("// $client->executeAndBreak();")])])]),t._v(" "),a("li",[a("p",[t._v("Create a link to the offerer in index.php, using the tracker variable "),a("code",[t._v("$client->getOffer()")])])])]),t._v(" "),a("div",{staticClass:"language-php line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[t._v("\n"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("body")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("a")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("href")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),a("span",{pre:!0,attrs:{class:"token php language-php"}},[a("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("<?php")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("echo")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$client")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getOffer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("?>")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("CLICK TO GO"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("a")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("body")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("html")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n")])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br"),a("span",{staticClass:"line-number"},[t._v("2")]),a("br"),a("span",{staticClass:"line-number"},[t._v("3")]),a("br"),a("span",{staticClass:"line-number"},[t._v("4")]),a("br"),a("span",{staticClass:"line-number"},[t._v("5")]),a("br")])]),a("p",[t._v("To go to a specific offer on a specific button.")]),t._v(" "),a("p",[t._v("Use the "),a("code",[t._v("$client->getOffer(array('offer_id' => ID))")]),t._v(" option:")]),t._v(" "),a("div",{staticClass:"language-html line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-html"}},[a("code",[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("a")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("href")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("<?php echo $client->getOffer(array("),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("'")]),t._v("offer_id"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("'")]),t._v(" => 123));?>"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("CLICK TO GO"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("a")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n")])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br")])]),a("p",[t._v("Where ID is the ID of the offer in the flow")]),t._v(" "),a("p",[a("img",{attrs:{src:s(445),alt:"",loading:"lazy"}})]),t._v(" "),a("p",[t._v("If the tracker will not return the offer, set the second parameter by default:")]),t._v(" "),a("div",{staticClass:"language-html line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-html"}},[a("code",[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("a")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("href")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("<?php echo $client->getOffer(null, "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("'")]),t._v("https://ya.ru"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("'")]),t._v(");?>"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("LINK"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("a")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n")])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br")])]),a("h2",{attrs:{id:"output-a-subid-on-a-page-to-pass-further"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#output-a-subid-on-a-page-to-pass-further"}},[t._v("#")]),t._v(" Output a subid on a page to pass further")]),t._v(" "),a("p",[t._v("To take the subid, and pass it somewhere else (for example, to affiliate network or CRM) without sending a postback by the tracker script — add the method "),a("code",[t._v("$client->getSubid();")]),t._v(" to your KClient PHP code")]),t._v(" "),a("p",[a("img",{attrs:{src:s(446),alt:"",loading:"lazy"}})]),t._v(" "),a("p",[t._v('Put the subid on the order form as `<input type="hidden" name="subid" value=<?echo "$subid"?> />``')]),t._v(" "),a("p",[a("img",{attrs:{src:s(447),alt:"",loading:"lazy"}})]),t._v(" "),a("p",[t._v("The configuration on the tracker side is completed. Next, pass "),a("code",[t._v("subid")]),t._v(" from the form to the handler (if needed), like "),a("code",[t._v('<form action="call.php" method="post" >')]),t._v(" or use any other method of capturing from the page and passing on the placeholder, suitable for affiliate networks or CRM, which you want to pass the subid and send to the postback in the tracker to.")]),t._v(" "),a("h2",{attrs:{id:"display-html-banners-in-specific-places-on-the-site"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#display-html-banners-in-specific-places-on-the-site"}},[t._v("#")]),t._v(" Display HTML (banners) in specific places on the site")]),t._v(" "),a("p",[t._v("KClient PHP is used to embedded banners in the code of the site, where the tracking code is added. For showing a banner in a certain place of the site, please, do the following:")]),t._v(" "),a("ol",[a("li",[t._v("Remove (comment out) the lines in the tracking code:")])]),t._v(" "),a("div",{staticClass:"language-php line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$client")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("execute")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("`"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("\n")])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br")])]),a("p",[t._v("And")]),t._v(" "),a("div",{staticClass:"language-php line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$client")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("executeAndBreak")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br")])]),a("ol",{attrs:{start:"2"}},[a("li",[t._v("Add to the tracking code:")])]),t._v(" "),a("div",{staticClass:"language-php line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$GLOBALS")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'client'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$client")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br")])]),a("ol",{attrs:{start:"3"}},[a("li",[t._v("Insert the code in the index.php or to the secondary page of the site:")])]),t._v(" "),a("div",{staticClass:"language-php line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token php language-php"}},[a("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("<?php")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("echo")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$GLOBALS")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'client'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getContent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("?>")])]),t._v("\n")])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br")])]),a("h2",{attrs:{id:"how-to-set-secondary-pages-of-the-site"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#how-to-set-secondary-pages-of-the-site"}},[t._v("#")]),t._v(" How to set secondary pages of the site")]),t._v(" "),a("ol",[a("li",[a("p",[t._v("Follow the instructions from the section Connection and Setup for connecting KClient PHP to a site;")])]),t._v(" "),a("li",[a("p",[t._v("Connect KClient PHP on the internal page by adding "),a("code",[t._v("$client->restoreFromSession();")])])])]),t._v(" "),a("div",{staticClass:"language-php line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token php language-php"}},[a("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("<?php")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("require_once")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("directory_name")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("__FILE__")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'/kclient.php'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$client")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KClickClient")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'http://domain_tracker/'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'token'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$client")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("restoreFromSession")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br"),a("span",{staticClass:"line-number"},[t._v("2")]),a("br"),a("span",{staticClass:"line-number"},[t._v("3")]),a("br"),a("span",{staticClass:"line-number"},[t._v("4")]),a("br"),a("span",{staticClass:"line-number"},[t._v("5")]),a("br")])]),a("p",[t._v("Now you may call the needed methods without creating a new click, for example, calling an offer on a secondary page:")]),t._v(" "),a("p",[a("code",[t._v('<a href="<?php echo $client->getOffer()">offer link</a>')])]),t._v(" "),a("h2",{attrs:{id:"methods"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#methods"}},[t._v("#")]),t._v(" Methods")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("Method")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[a("code",[t._v("$client->sendAllParams()")])]),t._v(" "),a("td",[t._v("Passing parameters from an address bar")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("$client->forceRedirectOffer()")])]),t._v(" "),a("td",[t._v("Enables redirects to offers. If offer is chosen in the flow, it will perform the redirection to it. In other case, you must use "),a("code",[t._v("getOffer()")])])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("$client->params('param1=c&param2=b')")])]),t._v(" "),a("td",[t._v("Passing parameters string")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("$client->param('extra_param_5', '123')")])]),t._v(" "),a("td",[t._v("Alternative method of passing a parameter")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("$client->sendUtmLabels()")])]),t._v(" "),a("td",[t._v("Passing UTM—labels from the address bar")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("$client->debug()")])]),t._v(" "),a("td",[t._v("Displaying the debugging information")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("$client->currentPageAsReferrer()")])]),t._v(" "),a("td",[t._v("Send the current page address as a referrer")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("$client->keyword('QUERY')")])]),t._v(" "),a("td",[t._v('Using the "QUERY" value as a keyword')])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("$client->execute()")])]),t._v(" "),a("td",[t._v("Executing Keitaro instructions with the continuation of the page code execution")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("$client->executeAndBreak()")])]),t._v(" "),a("td",[t._v('Executing Keitaro instructions with stoppage of the page execution. If the action "Do Nothing" is passed in the flow, the tracker won\'t stop for the page loading.')])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("$client->getOffer()")])]),t._v(" "),a("td",[t._v("Returns the offer link. The campaign must contain flows with schema 'Offers'. In other case, you'll receive 'no_offer'. Use this method if you don't want to perform automatic redirect to an offer.")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("$client->getBody()")])]),t._v(" "),a("td",[t._v("Get 'body' value")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("$client->getSubId()")])]),t._v(" "),a("td",[t._v("Returns SubId")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("$client->getHeaders()")])]),t._v(" "),a("td",[t._v("Get 'headers' value (array)")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("$client->isUnique(level)")])]),t._v(" "),a("td",[t._v("Uniqueness (level variations: flow, campaign, global)")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("$client->isBot()")])]),t._v(" "),a("td",[t._v("Bot status")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("$client->disableSessions()")])]),t._v(" "),a("td",[t._v("Turns off PHP session (without it, the cookie restoreFromSession won't work)")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("$client->restoreFromQuery()")])]),t._v(" "),a("td",[t._v("Catches query params "),a("code",[t._v("_subid")]),t._v(" and "),a("code",[t._v("_token")]),t._v(" without creating new click")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("$client->restoreFromSession()")])]),t._v(" "),a("td",[t._v("Restores previous click data from session without creating new click")])])])]),t._v(" "),a("h2",{attrs:{id:"debugging"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#debugging"}},[t._v("#")]),t._v(" Debugging")]),t._v(" "),a("p",[t._v("First, it is advisable to turn on debug mode.")]),t._v(" "),a("details",{staticClass:"custom-block details"},[a("summary",[t._v("How to turn on debug mode?")]),t._v(" "),a("p",[t._v("If there are no clicks, add to the end of the integration code:")]),t._v(" "),a("div",{staticClass:"language-php line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$client")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("showLog")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br")])]),a("p",[t._v("After "),a("code",[t._v("$client->execute()")]),t._v(" and "),a("code",[t._v("$client->executeAndBreak()")]),t._v(".")]),t._v(" "),a("p",[t._v("This will show the debug info on the page.")])]),t._v(" "),a("h2",{attrs:{id:"error-codes"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#error-codes"}},[t._v("#")]),t._v(" Error codes")]),t._v(" "),a("ul",[a("li",[a("code",[t._v("[REQ_ERR: 400]")]),t._v(" - This response means that the server could not understand the request because of response.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: 401]")]),t._v(" - The client must authenticate first to get the requested response.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: 403]")]),t._v(" - The client does not have access rights to the content.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: 404]")]),t._v(" - The server cannot find the requested resource.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: 405]")]),t._v(" - The request method is known by the server, but has been turned off and cannot be used.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: 407]")]),t._v(" - The authentication is needed to be performed by a proxy.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: 408]")]),t._v(" - Request timeout.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: 410]")]),t._v(" - The requested content has been permanently deleted from the server, with no forwarding address.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: 429]")]),t._v(" - The user has sent too many requests in a given amount of time.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: 500]")]),t._v(" - The server has encountered a situation it doesn't know how to handle.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: 501]")]),t._v(" - The request method is not supported by the server and cannot be handled.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: 502]")]),t._v(" - The server, while working as a gateway to get a response needed to handle the request, got an\ninvalid response.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: 503]")]),t._v(" - The server is not ready to handle the request. Common causes are that a server is down for\nmaintenance or is overloaded.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: 504]")]),t._v(" - The server is acting as a gateway and cannot get a response in time.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: 505]")]),t._v(" - The HTTP version used in the request is not supported by the server.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: UNSUPPORTED_PROTOCOL]")]),t._v(" - The URL you passed used a protocol that this cURL does not support.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: FAILED_INIT]")]),t._v(" - Very early initialization failed. This is likely to be an internal error or problem, or a\nresource problem where something fundamental couldn't get done at initial time.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: BAD_URL]")]),t._v(" - The URL was not properly formatted.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: COULDNT_RESOLVE_PROXY]")]),t._v(" - The given proxy host could not be resolved.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: COULDNT_RESOLVE_HOST]")]),t._v(" - The given remote host was not resolved. Check DNS settings of the domain.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: COULDNT_CONNECT]")]),t._v(" - Cannot connect to the tracker. Check if the server with Keitaro installed is up.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: PARTIAL_FILE]")]),t._v(" - A data transfer was shorter or larger than expected. Check Keitaro system log.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: READ_ERROR]")]),t._v(" - There was a problem reading data.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: OUT_OF_MEMORY]")]),t._v(" - A memory allocation request failed. You must increase "),a("code",[t._v("memory_limit")]),t._v(" on the client\nserver.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: OPERATION_TIMEDOUT]")]),t._v(" - The specified time-out period was reached according to the conditions.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: HTTP_POST_ERROR]")]),t._v(" - Internal post-request generation error.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: BAD_FUNCTION_ARGUMENT]")]),t._v(" - A function was called with a bad parameter.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: TOO_MANY_REDIRECTS]")]),t._v(" - There's a case of infinite redirects.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: GOT_NOTHING]")]),t._v(" - Nothing was returned from the server.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: SEND_ERROR]")]),t._v(" - Cannot send data to the tracker.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: RECV_ERROR]")]),t._v(" - Failure with receiving network data.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: BAD_CONTENT_ENCODING]")]),t._v(" - Unrecognized transfer encoding.")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: SSL]")]),t._v(" - SSL error. You must check Cloudflare settings (section SSL).")]),t._v(" "),a("li",[a("code",[t._v("[REQ_ERR: UNKNOWN]")]),t._v(" - Unknown error. Check Keitaro logs.")])]),t._v(" "),a("h2",{attrs:{id:"kclient-php-faq"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#kclient-php-faq"}},[t._v("#")]),t._v(" KClient PHP FAQ")]),t._v(" "),a("details",{staticClass:"custom-block details"},[a("summary",[t._v("Why does the page show status 500?")]),t._v(" "),a("p",[t._v("Add after "),a("code",[t._v("<?php")]),t._v(":")]),t._v(" "),a("div",{staticClass:"language-php line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("ini_set")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'display_errors'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'on'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("error_reporting")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br"),a("span",{staticClass:"line-number"},[t._v("2")]),a("br")])]),a("p",[a("img",{attrs:{src:s(448),alt:"",loading:"lazy"}})]),t._v(" "),a("p",[t._v("It must show the error message.")])]),t._v(" "),a("details",{staticClass:"custom-block details"},[a("summary",[t._v("Why doesn't HTTP-redirect work?")]),t._v(" "),a("p",[t._v("The file "),a("code",[t._v("index.php")]),t._v(" might contain a "),a("a",{attrs:{href:"https://www.w3.org/International/questions/qa-byte-order-mark",target:"_blank",rel:"noopener noreferrer"}},[t._v("BOM header"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("p",[t._v("Search for "),a("code",[t._v("Save UTF-8 without BOM")]),t._v(" in your editor.")])]),t._v(" "),a("details",{staticClass:"custom-block details"},[a("summary",[t._v("How to integrate KClient PHP with WordPress?")]),t._v(" "),a("p",[t._v("Use "),a("RouterLink",{attrs:{to:"/en/campaign-integrations/wordpress-plugin.html"}},[t._v("WordPress plugin")]),t._v(".")],1)]),t._v(" "),a("details",{staticClass:"custom-block details"},[a("summary",[t._v("How to leave specific visitors on the site?")]),t._v(" "),a("p",[t._v("Replace")]),t._v(" "),a("div",{staticClass:"language-php line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$client")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("execute")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br")])]),a("p",[t._v("With")]),t._v(" "),a("div",{staticClass:"language-php line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$client")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("executeAndBreak")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br")])])]),t._v(" "),a("details",{staticClass:"custom-block details"},[a("summary",[t._v("How to send title as a keyword?")]),t._v(" "),a("p",[t._v("You need to learn how to get title in php scripts. You need to send the keyword with "),a("code",[t._v("$client->keyword('...')")]),t._v(" method:")]),t._v(" "),a("div",{staticClass:"language-php line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$client")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("keyword")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$myTitle")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br")])]),a("p",[a("code",[t._v("$myTitle")]),t._v(" - is the example of how the variable content is transferred as a keyword.")])]),t._v(" "),a("details",{staticClass:"custom-block details"},[a("summary",[t._v("How to leave specific users on the site?")]),t._v(" "),a("p",[t._v('Use action "Do Nothing" in the flow.')])]),t._v(" "),a("details",{staticClass:"custom-block details"},[a("summary",[t._v("How to just check if visitor is a bot?")]),t._v(" "),a("p",[t._v("Use method "),a("code",[t._v("$client->isBot()")]),t._v(". Example:")]),t._v(" "),a("div",{staticClass:"language-php line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$client")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("isBot")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n   "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("echo")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'bot'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n   "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("echo")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'not bot'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br"),a("span",{staticClass:"line-number"},[t._v("2")]),a("br"),a("span",{staticClass:"line-number"},[t._v("3")]),a("br"),a("span",{staticClass:"line-number"},[t._v("4")]),a("br"),a("span",{staticClass:"line-number"},[t._v("5")]),a("br")])])]),t._v(" "),a("details",{staticClass:"custom-block details"},[a("summary",[t._v("How to insert the path to kclient.php if there are folders?")]),t._v(" "),a("p",[t._v("Check your site directory and put an obsolete path:")]),t._v(" "),a("div",{staticClass:"language-php line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("require")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'/path_to_the_website/kclient.php'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br")])])]),t._v(" "),a("details",{staticClass:"custom-block details"},[a("summary",[t._v("How to get a subid on the secondary pages?")]),t._v(" "),a("p",[t._v("The subid content is saved into a session:")]),t._v(" "),a("p",[a("code",[t._v("$_SESSION['sub_id'];")])]),t._v(" "),a("p",[t._v("Please use the following piece of code in your scripts:")]),t._v(" "),a("div",{staticClass:"language-php line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("session_start")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// it's better to launch the session if it wasn't used earlier. ")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("array")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'sub1'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$_SESSION")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'sub_id'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'name'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$_POST")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'name'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n  "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br"),a("span",{staticClass:"line-number"},[t._v("2")]),a("br"),a("span",{staticClass:"line-number"},[t._v("3")]),a("br"),a("span",{staticClass:"line-number"},[t._v("4")]),a("br"),a("span",{staticClass:"line-number"},[t._v("5")]),a("br"),a("span",{staticClass:"line-number"},[t._v("6")]),a("br"),a("span",{staticClass:"line-number"},[t._v("7")]),a("br")])])]),t._v(" "),a("details",{staticClass:"custom-block details"},[a("summary",[t._v("How to use Click Client on inner pages?")]),t._v(" "),a("p",[t._v("Enable Click Client on an inner page by adding "),a("code",[t._v("$client->restoreFromSession();")]),t._v(" :")]),t._v(" "),a("div",{staticClass:"language-php line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token php language-php"}},[a("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("<?php")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("require_once")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("dirname")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("__FILE__")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'/kclient.php'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$client")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KClient")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'https://..../api.php?'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'TOKEN'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$client")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("restoreFromSession")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br"),a("span",{staticClass:"line-number"},[t._v("2")]),a("br"),a("span",{staticClass:"line-number"},[t._v("3")]),a("br"),a("span",{staticClass:"line-number"},[t._v("4")]),a("br"),a("span",{staticClass:"line-number"},[t._v("5")]),a("br")])]),a("p",[t._v("Paste the code to create an offer link:")]),t._v(" "),a("div",{staticClass:"language-html line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-html"}},[a("code",[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("a")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("href")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("<?php echo $client->getOffer()"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("offer link"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("a")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n")])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br")])])])],1)}),[],!1,null,null,null);e.default=n.exports},349:function(t,e,s){t.exports=s.p+"assets/img/php_bot.0ca2c058.png"},439:function(t,e,s){t.exports=s.p+"assets/img/php_code.0b016577.png"},440:function(t,e,s){t.exports=s.p+"assets/img/kclient-php-ftp.b3f1f8cd.png"},441:function(t,e,s){t.exports=s.p+"assets/img/kclient-php-index.c361077d.png"},442:function(t,e,s){t.exports=s.p+"assets/img/kclient-php-bom.3ecbdf00.png"},443:function(t,e,s){t.exports=s.p+"assets/img/kclient_code.d7389352.png"},444:function(t,e,s){t.exports=s.p+"assets/img/kclient-php-traffic-log.0b9c0a7b.png"},445:function(t,e,s){t.exports=s.p+"assets/img/php_offer.a01650aa.png"},446:function(t,e,s){t.exports=s.p+"assets/img/getsubid.a55b75d6.png"},447:function(t,e,s){t.exports=s.p+"assets/img/echo-subid.fc579832.png"},448:function(t,e,s){t.exports=s.p+"assets/img/kclient-php-debu.2cb77900.png"}}]);