Questions & Answers

Questions you might have during the integration process of Evina's DCBprotect solution.

Where should the DCBprotect script be located ?

Sometimes, issues regarding interactions with the DCB script have been detected involving other scripts that have an action on click.

📘

Workaround

The script should be loaded last from the tag after all other scripts.

How should I manage Iframe ?

All window_urls must be whitelisted when you are using iframes for these pages.
Window_urls must have a domain that you should own.
If that's not the case, a fraud code will be detected: 2201.

Why is the script not running properly ?

The script must be placed before all other scripts in the tag.
In some cases, the script might not run as expected even if it is placed correctly. There are several cases where the script doesn’t execute properly.
For instance, when the page is dynamically loaded, the script cannot detect the DOMContentLoaded event or this event isn’t relevant because some elements are loaded with XHR.

To solve this problem, there is the “DCBProtectRun” event which triggers the actions normally associated with the DOMContentLoaded. This event should be fired when the page is loaded.

Here is how to trigger the event:

var event = new Event('DCBProtectRun');
document.dispatchEvent(event);

There is a conflict with the script ...

Another possible issue encountered during the integration is the script conflicting with other scripts on the page.
To solve this, there is a function to call which will prevent this conflict. The function evina_notify takes the click event as a parameter, and the callback function can be implemented by the partner with other page scripts.

See the example below:

if (typeof evina_notify === "function") {
evina_notify(e, function() {
//callback event
});
}

Warning: to prevent conflict with the default use case, the targeted_element on the call to API script needs to be “evina_notify”.

How to automatically manage the DCBprotect script ?

Is the script correctly loaded?

  • If yes there is an event load notification
  • Is the script present on the page? -You have to check the source code of the page
  • If present but not activated (no event load), it is possible to launch it manually
var event = new Event('DCBProtectRun');
document.dispatchEvent(event);

When the script is loaded (notification event load) is the button/buttons to be protected already present on the page?

If not, you should replay the event load

var event = new Event('DCBProtectRun');
document.dispatchEvent(event);

Are all the buttons on the page protected (class/id present in the get API call)?

If not, you should add the classes “te” in the GetScript API

Can the validation of the form be done without clicking?

Use case: the OK of the mobile keypad after entering the PIN number.
Solution:

var inputMsisdn = document.getElementById ('msisdn')
inputMsisdn.addEventListener ('click', function (e) {evina_notify (e);});

In that case, we click on the input to analyze the transaction

The click on the Call to Action button (CTA) is done via a javascript function

Use case : clicking on a player icon, postponing a javascript click on the CTA)
The easiest way is to protect the player too, otherwise we can use the evina_notify function see the description below

The CTA is well defined in the GET call but when I click, the click is considered as a javascript click
This can be due to an element whose size is misinterpreted by the browser.
In that case you must check with your browser console that the element encompasses its content.
To correct this point you must modify the CSS of the page.

How to manually manage the DCBprotect script?

How to manually trigger the script?

You have to use the following commands:

var event = new Event('DCBProtectRun');
document.dispatchEvent(event);

How to manually trigger the click notification?

You have to use the following commands:

evina_notify(event,function(){
//partner code associated to the click 
});

Here, the event is the click event.


Did this page help you?