Jump to content

On Response: Difference between revisions

From Wiki Kaminari Click
Marked this version for translation
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
Если вы хотите сами решать что делать с фродовыми показами, и, например, в зависимости от источника трафика редиректить их на разные URL, вам поможет опция '''onResponse'''.
<languages/>
<translate>
<!--T:1-->
'''For a walkthrough of On Response setup, watch the short video:
https://www.loom.com/share/6fa84d3f81ca431fb6cd66e1eea54a0e'''


'''Обратите внимание, опция доступна только в интеграциях типа ''JS check''.'''
<!--T:15-->
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.


= Подключение опции =
<!--T:2-->
Закажите у менеджера включение опции '''onResponse''' на своей интеграции. После того как её включат, реализуйте её логику.  
'''Please note that this option is only available in ''JS check'' type integrations.'''


<!--T:3-->
= Option Activation =
Request the activation of the '''onResponse''' option from your manager for your integration. Once enabled, implement its logic after activation.
<!--T:4-->
[[File:On response.png]]
[[File:On response.png]]


После реализации функции, она появится в поле ''window.kmnr.onResponse'' в сгенерированном коде скрипта, который вы можете скопировать кнопкой ''Copy'' и разместить у себя на странице в теге <code><body></code>.
<!--T:5-->
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 <code><head></code> tag.


<!--T:6-->
[[File:On response2.png]]
[[File:On response2.png]]


= Сигнатура =
= Signature = <!--T:7-->
 
<!--T:8-->
The function takes an object <code>{ fraud, block, reason }</code>.
 
<!--T:12-->
''fraud'' is '''0''' for a legitimate impression and '''1''' for a bot impression. ''block'' is '''0''' for a legitimate impression and '''1''' when the click was blocked according to the integration settings. ''reason'' is the IVT category behind the verdict, or an empty string.
 
<!--T:13-->
''reason'' is one of: <code>Spoofing</code>, <code>Automated</code>, <code>Crawler</code>, <code>Bad reputation IP</code>, <code>Incorrect requests</code>. In statistics, <code>Crawler</code> is labeled Crawlers.


Функция принимает на вход объект <code>{ fraud }</code>, где ''fraud'' может иметь значение '''0''' (хороший показ) или '''1''' (ботовый показ).
<!--T:14-->
''reason'' is an empty string in four cases:


<!--T:16-->
* the impression is clean
* the impression is suspicious; ''reason'' is filled only for an IVT category
* the impression is a technical loss
* ''block'' is '''1''' because of your IVT Settings (for example VPN, Tor, or proxy), and the impression has no IVT category
<!--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
        // response.reason: Spoofing, Automated, Crawler, Bad reputation IP, Incorrect requests
         window.location = 'some.url';
         window.location = 'some.url';
     } else {
     } else {
         // not a bot
         // not a bot
        // response.reason: ""
         showAd();
         showAd();
     }
     }
Line 28: Line 62:
</pre>
</pre>


= Взаимодействие с Traffic-back URL =
<!--T:17-->
Если на вашей интеграции одновременно включены и опция '''onResponse''', и опция '''[[Traffic_back_URL|Traffic-back URL]]''', то поскольку '''onResponse''' обладает большим приоритетом, '''Traffic-back URL''' будет игнорироваться.
= Interaction with 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-->
[[Category:Features]]
[[Category:Features]]
</translate>

Latest revision as of 15:04, 3 November 2026

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.

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.

Signature

The function takes an object { fraud, block, reason }.

fraud is 0 for a legitimate impression and 1 for a bot impression. block is 0 for a legitimate impression and 1 when the click was blocked according to the integration settings. reason is the IVT category behind the verdict, or an empty string.

reason is one of: Spoofing, Automated, Crawler, Bad reputation IP, Incorrect requests. In statistics, Crawler is labeled Crawlers.

reason is an empty string in four cases:

  • the impression is clean
  • the impression is suspicious; reason is filled only for an IVT category
  • the impression is a technical loss
  • block is 1 because of your IVT Settings (for example VPN, Tor, or proxy), and the impression has no IVT category
function(response) {
    if (response.block == 1) {
        // blocked click
        window.location = 'some.url';
    } else if (response.fraud == 1) {
        // bot
        // response.reason: Spoofing, Automated, Crawler, Bad reputation IP, Incorrect requests
        window.location = 'some.url';
    } else {
        // not a bot
        // response.reason: ""
        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.