Download clickworker/en: Difference between revisions

From Wiki Kaminari Click
(Updating to match new version of source page)
(Updating to match new version of source page)
 
Line 1: Line 1:
<languages/>
<languages/>
To verify click-through links, we use a ''clickworker'', a special page on our domain.
By default, to verify click-through links for [[Meta redirect|Meta Redirect-type integrations]], we use a ''clickworker'', a special page on the Kaminari Click domain, which checks the user and then redirects good users to the target link, and bots to [[Traffic back URL|traffic-back URL]], if the corresponding option is enabled. This approach is as simple and convenient as possible, but has a number of disadvantages.


If you want to avoid losses and delays in cross-domain redirects, you can download the clickworker and host it on your server. It needs to be updated once a day because we regularly make changes to the scripts.
# If suddenly a technical problem occurs on our server, the redirect breaks down and your traffic will be lost.
# Redirects between different sites are slower than within one site, so a redirect through our clickworker can increase the percentage of non-revenue to the target link.
# You may feel uncomfortable that a third party is included in the redirect chain.


'''Please note that this option is only available for ''Redirect''-type integrations.'''
To solve these problems, we suggest downloading the ''clickworker'' and hosting it on your server. It needs to be updated '''once a day''' because we regularly make changes to the scripts.
 
'''Please note that this option is only available for ''Meta Redirect''-type integrations.'''


= Option Activation =
= Option Activation =
Line 17: Line 21:


[[File:Download clickworker2.png]]
[[File:Download clickworker2.png]]
<br />
<br />


When delivering the clickworker to the user, you can dynamically replace the templates with current data.
When delivering the clickworker to the user, you can dynamically replace the templates with current data.


== Templates description ==
{| class="wikitable"
{| class="wikitable"
|-
|-
! Name !! Description
! Name !! Description !! Note
|-
|-
| kmnrId || kmnrId, generated during the ping at {{KamiLink|v2/ping}}. Needed for linking clicks if the '''[[S2S ping]]''' option is enabled.
| kmnrId || kmnrId, generated during the ping at {{KamiLink|v2/ping}}. Needed for linking clicks if the '''[[S2S ping]]''' option is enabled. || Required if the option [[S2S ping]] is enabled
|-
|-
| kmnrKey || Integration identifier under which the impression is analyzed.
| kmnrKey || Integration identifier under which the impression is analyzed. || Required parameter
|-
|-
| sub1 || Filled sub-tags. If you are not using certain tags, it is not mandatory to send them.
| sub1 || Filled sub-tags. If you are not using certain tags, it is not mandatory to send them. || -
|-
|-
| sub2 || ...
| sub2 || ... || -
|-
|-
| sub3 || ...
| sub3 || ... || -
|-
|-
| sub4 || ...
| sub4 || ... || -
|-
|-
| sub5 || ...
| sub5 || ... || -
|-
|-
| sub6 || ...
| sub6 || ... || -
|-
|-
| sub7 || ...
| sub7 || ... || -
|-
|-
| sub8 || ...
| sub8 || ... || Available if the option [[Additional subs]] is enabled
|-
|-
| sub9 || ...
| sub9 || ... || Available if the option [[Additional subs]] is enabled
|-
|-
| sub10 || ...
| sub10 || ... || Available if the option [[Additional subs]] is enabled
|-
|-
| u || The target link to which the user will be directed after verification. It should be in a URL-safe format (for example, processed with the JavaScript method [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent encodeURIComponent]).
| u || The target link to which the user will be directed after verification. It should be in a URL-safe format (for example, processed with the JavaScript method [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent encodeURIComponent]). || Required parameter if the option [[Target URL|Target URL]] is not enabled
|}
|}
If you are not using kmnrId, or you do not need all sub-tags, or if you have [[Traffic back URL|Traffic-back URL]] instead of clickUrl, simply remove unnecessary templates from the link.


<pre>https://kaminari.space/v1/click?kmnrKey=767073697&sub1={sub1}&sub2={sub2}&u={clickUrl}&download</pre>
<pre>https://kaminari.space/v1/click?kmnrKey=767073697&sub1={sub1}&sub2={sub2}&u={clickUrl}&download</pre>
Line 58: Line 63:
For the clickworker to function correctly, it must send the following headers to the user's browser:
For the clickworker to function correctly, it must send the following headers to the user's browser:
<pre>
<pre>
access-control-allow-origin: *
access-control-allow-methods: GET, POST, OPTIONS
access-control-allow-headers: X-Requested-With, Cache-Control, Content-Type
accept-ch: Width, Viewport-Width, DPR, Device-Memory, Downlink, RTT, ECT, Save-Data, Sec-CH-UA-Arch, Sec-CH-UA-Bitness, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA-Platform, Sec-CH-UA-Platform-Version, Sec-CH-UA, Sec-CH-UA-Full-Version
accept-ch: Width, Viewport-Width, DPR, Device-Memory, Downlink, RTT, ECT, Save-Data, Sec-CH-UA-Arch, Sec-CH-UA-Bitness, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA-Platform, Sec-CH-UA-Platform-Version, Sec-CH-UA, Sec-CH-UA-Full-Version
access-control-allow-headers: X-Requested-With, Cache-Control, Content-Type
access-control-allow-methods: GET, POST, OPTIONS
access-control-allow-origin: *
</pre>
</pre>
= Example implementation =
Below is an example of the simplest implementation of a clickworker on your side using PHP.
Let's say that you own a website '''my-site.com''' and people come to you through links like this:
<pre>https://my-site.com/click.php?utm_source=1&utm_campaign=123&utm_click_id=93652664834&target=https%3A%2F%2Fgoogle.com</pre>
And you want Kaminari Click to check the user for fraud and redirect to the target link (in this case, google).
== Making a link ==
You decided that you will take the data directly from the GET parameters and that ''utm_source'' will be written in '''sub1''', ''utm_campaign'' in '''sub2''' and ''utm_click_id'' in '''sub3'''.
Next, in your integration settings you need to copy the link for clickworker downloading and replace the templates you need, that is, {sub1}, {sub2}, {sub3}, {clickUrl}, the rest can be deleted.
[[File:Clickworker-link.png]]
As a result, you will get a link like this:
<pre>https://kaminari.space/v1/click?kmnrKey=XXXXXXXXX&sub1=<?=$_GET['utm_source']?>&sub2=<?=$_GET['utm_campaign']?>&sub3=<?=$_GET['utm_source_id']?>&u=<?=$_GET['target']?>&download</pre>
== Downloading a clickworker ==
Using the resulting link, download the clickworker and save it to the file '''clickworker.php'''
[[File:Clickworker-page2.png]]
Then you need to create a '''click.php''' file, put the headers in it and include '''clickworker.php'''
<pre>
<?php
    header('Access-Control-Allow-Origin: *');
    header('access-control-allow-methods: GET, POST, OPTIONS');
    header('access-control-allow-headers: X-Requested-With, Cache-Control, Content-Type');
    header('accept-ch: Width, Viewport-Width, DPR, Device-Memory, Downlink, RTT, ECT, Save-Data, Sec-CH-UA-Arch, Sec-CH-UA-Bitness, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA-Platform, Sec-CH-UA-Platform-Version, Sec-CH-UA, Sec-CH-UA-Full-Version');
   
    include_once('clickworker.php');
</pre>
The both files must be uploaded on the website.
== Testing ==
To check, go to the link in your browser:
<pre>https://my-site.com/click.php?utm_source=1&utm_campaign=123&utm_click_id=93652664834&target=https%3A%2F%2Fgoogle.com</pre>
Great job! The redirect worked and you ended up on Google’s website.
[[File:Clickworker-redirect2.png]]
<br />
<br />
Time to check the statistics.
Excellent result. The click was counted, the tags were placed correctly.
[[File:Clickworker-stat.png]]


[[Category:Features]]
[[Category:Features]]

Latest revision as of 06:52, 20 April 2024

Other languages:

By default, to verify click-through links for Meta Redirect-type integrations, we use a clickworker, a special page on the Kaminari Click domain, which checks the user and then redirects good users to the target link, and bots to traffic-back URL, if the corresponding option is enabled. This approach is as simple and convenient as possible, but has a number of disadvantages.

  1. If suddenly a technical problem occurs on our server, the redirect breaks down and your traffic will be lost.
  2. Redirects between different sites are slower than within one site, so a redirect through our clickworker can increase the percentage of non-revenue to the target link.
  3. You may feel uncomfortable that a third party is included in the redirect chain.

To solve these problems, we suggest downloading the clickworker and hosting it on your server. It needs to be updated once a day because we regularly make changes to the scripts.

Please note that this option is only available for Meta Redirect-type integrations.

Option Activation

Request the activation of the Download Clickworker option from your manager for your integration. Once enabled, a download link will appear in the integration for you to retrieve the clickworker.

Download clickworker.png

Templates

The curly brackets in the link contain templates, and they will be passed into the code as they are.

https://kaminari.space/v1/click?kmnrKey=XXXXXXXXX&kmnrId={kmnrId}&sub1={sub1}&sub2={sub2}&sub3={sub3}&sub4={sub4}&sub5={sub5}&sub6={sub6}&sub7={sub7}&u={clickUrl}&download

Download clickworker2.png

When delivering the clickworker to the user, you can dynamically replace the templates with current data.

Templates description

Name Description Note
kmnrId kmnrId, generated during the ping at https://kaminari.systems/v2/ping. Needed for linking clicks if the S2S ping option is enabled. Required if the option S2S ping is enabled
kmnrKey Integration identifier under which the impression is analyzed. Required parameter
sub1 Filled sub-tags. If you are not using certain tags, it is not mandatory to send them. -
sub2 ... -
sub3 ... -
sub4 ... -
sub5 ... -
sub6 ... -
sub7 ... -
sub8 ... Available if the option Additional subs is enabled
sub9 ... Available if the option Additional subs is enabled
sub10 ... Available if the option Additional subs is enabled
u The target link to which the user will be directed after verification. It should be in a URL-safe format (for example, processed with the JavaScript method encodeURIComponent). Required parameter if the option Target URL is not enabled
https://kaminari.space/v1/click?kmnrKey=767073697&sub1={sub1}&sub2={sub2}&u={clickUrl}&download

Headers

For the clickworker to function correctly, it must send the following headers to the user's browser:

access-control-allow-origin: *
access-control-allow-methods: GET, POST, OPTIONS
access-control-allow-headers: X-Requested-With, Cache-Control, Content-Type
accept-ch: Width, Viewport-Width, DPR, Device-Memory, Downlink, RTT, ECT, Save-Data, Sec-CH-UA-Arch, Sec-CH-UA-Bitness, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA-Platform, Sec-CH-UA-Platform-Version, Sec-CH-UA, Sec-CH-UA-Full-Version

Example implementation

Below is an example of the simplest implementation of a clickworker on your side using PHP.

Let's say that you own a website my-site.com and people come to you through links like this:

https://my-site.com/click.php?utm_source=1&utm_campaign=123&utm_click_id=93652664834&target=https%3A%2F%2Fgoogle.com

And you want Kaminari Click to check the user for fraud and redirect to the target link (in this case, google).

Making a link

You decided that you will take the data directly from the GET parameters and that utm_source will be written in sub1, utm_campaign in sub2 and utm_click_id in sub3.

Next, in your integration settings you need to copy the link for clickworker downloading and replace the templates you need, that is, {sub1}, {sub2}, {sub3}, {clickUrl}, the rest can be deleted.

Clickworker-link.png

As a result, you will get a link like this:

https://kaminari.space/v1/click?kmnrKey=XXXXXXXXX&sub1=<?=$_GET['utm_source']?>&sub2=<?=$_GET['utm_campaign']?>&sub3=<?=$_GET['utm_source_id']?>&u=<?=$_GET['target']?>&download

Downloading a clickworker

Using the resulting link, download the clickworker and save it to the file clickworker.php

Clickworker-page2.png

Then you need to create a click.php file, put the headers in it and include clickworker.php

<?php

    header('Access-Control-Allow-Origin: *');
    header('access-control-allow-methods: GET, POST, OPTIONS');
    header('access-control-allow-headers: X-Requested-With, Cache-Control, Content-Type');
    header('accept-ch: Width, Viewport-Width, DPR, Device-Memory, Downlink, RTT, ECT, Save-Data, Sec-CH-UA-Arch, Sec-CH-UA-Bitness, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA-Platform, Sec-CH-UA-Platform-Version, Sec-CH-UA, Sec-CH-UA-Full-Version');
    
    include_once('clickworker.php');

The both files must be uploaded on the website.

Testing

To check, go to the link in your browser:

https://my-site.com/click.php?utm_source=1&utm_campaign=123&utm_click_id=93652664834&target=https%3A%2F%2Fgoogle.com

Great job! The redirect worked and you ended up on Google’s website.

Clickworker-redirect2.png

Time to check the statistics. Excellent result. The click was counted, the tags were placed correctly.

Clickworker-stat.png