e-satisfaction

The #1 Humanized Marketing Platform

(Version 1.3) What is the integration process for the badge?

Follow

This is the script that must be placed in the e-shop code to display the badge in any form/mode.

 


var client_id = "YOUR_SITE_ID",

client_public_key = "YOUR_PUBLIC_KEY",
client_private_key = "yOUR_PRIVATE_KEY",
badge_mode = "both";  // options: banner, bar and both

window.esat = window.esat || {}, window.esat.badge = window.esat.badge || {}, window.esat.badge.options = {};
window.esat.badge.banner = {}, window.esat.badge.banner.options = {};
window.esat.badge.lightbox = {}, window.esat.badge.lightbox.options = {};
window.esat.badge.preload = function (a, b, c, d) {
if (!window.jQuery) {
    var f = document.createElement("script");
    f.type = "text/javascript", f.src = "https://www.e-satisfaction.gr/badge-1.3/src/jquery/jquery-2.1.4.min.js";
    var g = document.getElementsByTagName("script")[0];
    g.parentNode.insertBefore(f, g)
}
setTimeout(function () {
    f = document.createElement("script");
    f.type = "text/javascript", f.async = !0, f.src = "https://www.e-satisfaction.gr/badge-1.3/src/badge/js/preloader.js";
    g = document.getElementsByTagName("script")[0];
    g.parentNode.insertBefore(f, g), window.esat.badge.provider = {}, window.esat.badge.provider.client_id = a, window.esat.badge.provider.public_key = b, window.esat.badge.provider.private_key = c, window.esat.badge.options.mode = d
}, 500);
};

window.esat.badge.preload(client_id, client_public_key, client_private_key, badge_mode);
window.esat.badge.banner.options.holder = '.badge_holder';
window.esat.badge.banner.options.bar_holder = '.bar_holder';
									    

Important note: At the point where you would like to display the banner you should create an empty div with the selector you have set, e.g <div class="badge_holder"></div> 

The following parameters are needed to initialize the badge:

  1.   client_id: The site id from the database 
  2.   client_public_key: Client's public key 
  3.   client_private_key: Client's private key
  4.   badge_mode: The badge display mode. It can be one of the following: 
    •  banner: Display the banner  
    •  bar: Display the bar on the top of the page 
    •  both: Display both banner and bar 
    •  lightbox: Display lightbox in embedded form

 

Was this article helpful?
0 out of 0 found this helpful

Comments