Integrate WebEngage with your Website

One-time integration. Non-blocking, optimized and secure code

After sign-up, copy and paste the code snippet underneath (you'll also get the code in your dashboard) in your web pages - preferably in the header. This integration bit is a one time activity and any customizations done inside your WebEngage dashboard (w.r.t. feedback, surveys or notifications) doesn't need any further code changes on your site.
<script id="_webengage_script_tag" type="text/javascript">
    var webengage; !function(e,t,n){function o(e,t){e[t[t.length-1]]=function(){r.__queue.push([t.join("."),arguments])}}var i,s,r=e[n],g=" ",l="init options track screen onReady".split(g),a="feedback survey notification".split(g),c="options render clear abort".split(g),p="Open Close Submit Complete View Click".split(g),u="identify login logout setAttribute".split(g);if(!r||!r.__v){for(e[n]=r={__queue:[],__v:"6.0",user:{}},i=0;i<l.length;i++)o(r,[l[i]]);for(i=0;i<a.length;i++){for(r[a[i]]={},s=0;s<c.length;s++)o(r[a[i]],[a[i],c[s]]);for(s=0;s<p.length;s++)o(r[a[i]],[a[i],"on"+p[s]])}for(i=0;i<u.length;i++)o(r.user,["user",u[i]]);setTimeout(function(){var f=t.createElement("script"),d=t.getElementById("_webengage_script_tag");f.type="text/javascript",f.async=!0,f.src=("https:"==t.location.protocol?"https://ssl.widgets.webengage.com":"http://cdn.widgets.webengage.com")+"/js/webengage-min-v-6.0.js",d.parentNode.insertBefore(f,d)})}}(window,document,"webengage");

    webengage.init('_YOUR_LICENSE_CODE_');
</script>
        
Alternately, you can inject the following snippet using any tag manager (e.g. GTM).
<div id="_webengage_script_tag"></div><script type="text/javascript">
    var webengage; !function(e,t,n){function o(e,t){e[t[t.length-1]]=function(){r.__queue.push([t.join("."),arguments])}}var i,s,r=e[n],g=" ",l="init options track screen onReady".split(g),a="feedback survey notification".split(g),c="options render clear abort".split(g),p="Open Close Submit Complete View Click".split(g),u="identify login logout setAttribute".split(g);if(!r||!r.__v){for(e[n]=r={__queue:[],__v:"6.0",user:{}},i=0;i<l.length;i++)o(r,[l[i]]);for(i=0;i<a.length;i++){for(r[a[i]]={},s=0;s<c.length;s++)o(r[a[i]],[a[i],c[s]]);for(s=0;s<p.length;s++)o(r[a[i]],[a[i],"on"+p[s]])}for(i=0;i<u.length;i++)o(r.user,["user",u[i]]);setTimeout(function(){var f=t.createElement("script"),d=t.getElementById("_webengage_script_tag");f.type="text/javascript",f.async=!0,f.src=("https:"==t.location.protocol?"https://ssl.widgets.webengage.com":"http://cdn.widgets.webengage.com")+"/js/webengage-min-v-6.0.js",d.parentNode.insertBefore(f,d)})}}(window,document,"webengage");

    webengage.init('_YOUR_LICENSE_CODE_');
</script>
            

When you paste, replace _YOUR_LICENSE_CODE_ with your account's license code. You'll find your license code in WebEngage dashboard.

This code loads and initializes WebEngage asynchronously, so that it does not block loading of your web pages. This is cautiously done to not impact page load time on your website. During initialisation, our code waits for DOMContentLoaded event before modifying the DOM for loading further resources, ensuring it doesn't delay DOMContentLoaded.

Note the script URLs in the above code are protocol relative. All our resources are loaded over the same protocol (HTTP or HTTPS) as the containing page, which prevents "Insecure Content" warnings.