How to add FraudLabs Pro Agent Javascript for OpenCart or later

Device tracking, or device fingerprinting, is a proven method to uniquely identify a user. As compared to the IP tracking where users can easily hide their device IP address using a proxy or VPN, this feature will uniquely label the device and permanently store the device information in our system for validation. This will increase the level of difficulty for users to tamper with this information to fool the system into thinking that they are new buyers.

As a result, if the clients used proxies to alter their IP addresses to make multiple purchases, they can be easily tracked down using the device validation rule. Besides, you can easily find out if a client’s device had been reported and blacklisted by other merchants in our merchant network. Similarly, you may also blacklist this device against future purchases if any malicious act was discovered during the fraud validation.

In order to enable the device validation feature, FraudLabs Pro Agent Javascript has to be added into your website. It can be either added into the header or the footer of your page. Once you have the device tracking enabled, you shall be able to view the device information at the transaction details page. This tutorial will guide you on how to add the FraudLabs Pro Agent Javascript for OpenCart version or later.

Below are the code of FraudLabs Pro Agent Javascript:

  function s() {
    var e = document.createElement('script');
    e.type = 'text/javascript';
    e.async = true;
    e.src = ('https:' === document.location.protocol ? 'https://' : 'http://') + '';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(e, s);
  (window.attachEvent) ? window.attachEvent('onload', s) : window.addEventListener('load', s, false);

The following steps show how to add the FraudLabs Pro Agent Javascript for OpenCart or later:

  1. Go to opencart/catalog/view/theme/YOUR_THEME/template/common/.
  2. Edit the footer.twig file inside the common folder.
  3. Copy the code provided above and paste it before the closing body tag “</body>” of the footer.tpl file.
  4. Clear the OpenCart cache at opencart/system/storage/cache.
  5. Done.

Was this article helpful?

Related Articles