On Response: Difference between revisions

From Wiki Kaminari Click
(Marked this version for translation)
No edit summary
Line 2: Line 2:
<translate>
<translate>
<!--T:1-->
<!--T:1-->
Если вы хотите сами решать что делать с фродовыми показами, и, например, в зависимости от источника трафика редиректить их на разные URL, вам поможет опция '''onResponse'''.
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-->
<!--T:2-->
'''Обратите внимание, опция доступна только в интеграциях типа ''JS check''.'''
'''Please note that this option is only available in ''JS check'' type integrations.'''


<!--T:3-->
<!--T:3-->
= Подключение опции =
= Option Activation =
Закажите у менеджера включение опции '''onResponse''' на своей интеграции. После того как её включат, реализуйте её логику.  
Request the activation of the '''onResponse''' option from your manager for your integration. Once enabled, implement its logic after activation.  


<!--T:4-->
<!--T:4-->
Line 15: Line 15:


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


= Сигнатура = <!--T:7-->
= Signature = <!--T:7-->


<!--T:8-->
<!--T:8-->
Функция принимает на вход объект <code>{ fraud }</code>, где ''fraud'' может иметь значение '''0''' (хороший показ) или '''1''' (ботовый показ).
The function takes as argument object <code>{ fraud }</code>, where ''fraud'' can have a value of '''0''' (legitimate impression) or '''1''' (bot impression).


<!--T:9-->
<!--T:9-->
Line 39: Line 39:


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



Revision as of 15:35, 30 November 2023

Other languages:

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 }, where fraud can have a value of 0 (legitimate impression) or 1 (bot impression).

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

Interaction with Traffic-back URL

Если на вашей интеграции одновременно включены и опция onResponse, и опция Traffic-back URL, то поскольку onResponse обладает большим приоритетом, Traffic-back URL будет игнорироваться.