e-satisfaction

The #1 Humanized Marketing Platform

Badge Integration

Follow

Introduction

This article will guide you through the e-satisfaction simple integration using Javascript code. It will allow the e-satisfaction Badge to appear to your site.

Before we Start

This guide will show you the main Javascript code and some examples on how to integrate the e-satisfaction badge script to your website.

However, since it's a library embedded to other websites, there are some restrictions regarding the jQuery version, the Operating System and the Browser.

Badge Configuration

IMPORTANT: In order for the badge to be displayed, you have to visit your dashboard and update all the integration settings for your badge in the application profile page. All the settings will be applied immediately.

Read more about your Badge Configuration Layout and the Badge Configuration Metrics.

jQuery Compatibility

e-satisfaction Badge uses jQuery to make it easier for us and the website to operate. However, restrictions and best practices exist.

Read more about our jQuery Compatibility.

OS and Browser Compatibility

Although we are trying to keep our Script as clean and as tidy as possible, we cannot cover all Operating Systems and Browsers.

Read more about our OS and Browser Compatibility.

Information Needed

One final step before we start integrating the e-satisfaction Integration Library, we are going to need get the Application Id from the dashboard settings, as the screenshot displays:

Library

Place the following script in the head section of your website.

Replace YOUR-APPLICATION-ID with the application id that you got from the previous step.

Case 1: Your website DOES NOT have jQuery

(function (w, d, id, jq, o) {
   // Define e-satisfaction badge configuration
   o = o || {};
   o.application_id = id;
   w.esat_badge = o;

   // Setup script
   var l = function () {
       var r = d.getElementsByTagName('script')[0], s = d.createElement('script');
       s.async = true;
       s.src = 'https://cdn.e-satisfaction.com/clients/badge/v3.0/js/badge' + (!!jq ? '.jq' : '') + '.min.js';
       r.parentNode.insertBefore(s, r);
   };

   if (w.attachEvent) {
       w.attachEvent('onload', l);
   } else {
       w.addEventListener('load', l, false);
   }
})(window, document, 'YOUR-APPLICATION-ID', true, {});

NOTE: The jQuery embedded with the above script is v3.2.1.

Case 2: Your website DOES have jQuery

(function (w, d, id, jq, o) {
   // Define e-satisfaction badge configuration
   o = o || {};
   o.application_id = id;
   w.esat_badge = o;

   // Setup script
   var l = function () {
       var r = d.getElementsByTagName('script')[0], s = d.createElement('script');
       s.async = true;
       s.src = 'https://cdn.e-satisfaction.com/clients/badge/v3.0/js/badge' + (!!jq ? '.jq' : '') + '.min.js';
       r.parentNode.insertBefore(s, r);
   };

   if (w.attachEvent) {
       w.attachEvent('onload', l);
   } else {
       w.addEventListener('load', l, false);
   }
})(window, document, 'YOUR-APPLICATION-ID', false, {});

By adding the above script, the badge will automatically be displayed to your customers.

Override Integration Configuration

Integration for Badge in your application is configured through your dashboard. However, you might need to customize your configuration on each page differently.

Read more about Override Badge Integration Configuration.

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

Have more questions? Submit a request