On Response: Difference between revisions

From Wiki Kaminari Click
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
<translate>
<translate>
<!--T:1-->
<!--T:1-->
'''For a walkthrough of On Response setup, watch the short video:
https://www.loom.com/share/6fa84d3f81ca431fb6cd66e1eea54a0e'''
If you want to take control of handling fraudulent impressions yourself, for example, redirecting them to different URLs based on the traffic source, the '''onResponse''' option will assist you.
If you want to take control of handling fraudulent impressions yourself, for example, redirecting them to different URLs based on the traffic source, the '''onResponse''' option will assist you.


Line 23: Line 26:


<!--T:8-->
<!--T:8-->
The function takes as argument object <code>{ fraud }</code>, where ''fraud'' can have a value of '''0''' (legitimate impression) or '''1''' (bot impression).
The function takes as argument object <code>{ fraud, block }</code>, where ''fraud'' can have a value of '''0''' (legitimate impression) or '''1''' (bot impression), and ''block'' can have a value of '''0''' (legitimate impression) or '''1''' (click was blocked according to the integration settings)


<!--T:9-->
<!--T:9-->
<pre>
<pre>
function(response) {
function(response) {
     if (response.fraud == 1) {
     if (response.block == 1) {
        // blocked click
        window.location = 'some.url';
    } else if (response.fraud == 1) {
         // bot
         // bot
         window.location = 'some.url';
         window.location = 'some.url';
Line 40: Line 46:
<!--T:10-->
<!--T:10-->
= Interaction with Traffic-back URL =
= Interaction with Traffic-back URL =
Если на вашей интеграции одновременно включены и опция '''onResponse''', и опция '''[[Traffic_back_URL|Traffic-back URL]]''', то поскольку '''onResponse''' обладает большим приоритетом, '''Traffic-back URL''' будет игнорироваться.
If you have an integration with both the '''onResponse''' and '''[[Traffic_back_URL|Traffic-back URL]]''' options enabled, keep in mind that '''onResponse''' takes precedence. In this case, the '''Traffic-back URL''' will be ignored.


<!--T:11-->
<!--T:11-->
[[Category:Features]]
[[Category:Features]]
</translate>
</translate>

Latest revision as of 07:19, 2 September 2026

Other languages:

For a walkthrough of On Response setup, watch the short video: https://www.loom.com/share/6fa84d3f81ca431fb6cd66e1eea54a0e

If you want to take control of handling fraudulent impressions yourself, for example, redirecting them to different URLs based on the traffic source, the onResponse option will assist you.

Please note that this option is only available in JS check type integrations.

Option Activation

Request the activation of the onResponse option from your manager for your integration. Once enabled, implement its logic after activation.

On response.png

After implementing the function, it will appear in the window.kmnr.onResponse field in the generated script code, which you can copy using the Copy button and place on your page within the <head> tag.

On response2.png

Signature

The function takes as argument object { fraud, block }, where fraud can have a value of 0 (legitimate impression) or 1 (bot impression), and block can have a value of 0 (legitimate impression) or 1 (click was blocked according to the integration settings)

function(response) {
    if (response.block == 1) {
        // blocked click
        window.location = 'some.url';
    } else if (response.fraud == 1) {
        // bot
        window.location = 'some.url';
    } else {
        // not a bot
        showAd();
    }
}

Interaction with Traffic-back URL

If you have an integration with both the onResponse and Traffic-back URL options enabled, keep in mind that onResponse takes precedence. In this case, the Traffic-back URL will be ignored.