Gleap
Search…
JavaScript
The Gleap SDK for JavaScript is the easiest way to integrate Gleap into your apps. Communicate with your users directly and build better software by discovering their everyday pain points. Gleap is your all-in-one customer feedback tool for apps and websites.
For the SDK to work, you need an API key, which you can get for free at app.gleap.io.

πŸ— Installation

Add the following code snippet to the <head>-tag of your website or web app. Replace API-KEY with your API key. The snippet below will load the Gleap widget asynchronously, to ensure it won't affect your page speed.
1
<script>
2
!function(Gleap,e,key){if(Gleap=window.Gleap=[],!Gleap.initialize)if(Gleap.invoked)window.console&&console.error&&console.error('Gleap SDK included twice.');else{for(Gleap.invoked=!0,Gleap.methods=['identify','clearIdentity','attachCustomData','setCustomData','removeCustomData','clearCustomData','registerCustomAction','logEvent','sendSilentBugReport','startFeedbackFlow','open','hide','on','setLanguage'],Gleap.f=function(e){return function(){var a=Array.prototype.slice.call(arguments);return Gleap.push({e,a}),Gleap;};},e=0;e<Gleap.methods.length;e++)key=Gleap.methods[e],Gleap[key]=Gleap.f(key);Gleap.load=function(k){var t=document.createElement('script');t.type='text/javascript',t.async=!0,t.src='https://widget.gleap.io/widget/'+k;var n=document.getElementsByTagName('script')[0];n.parentNode.insertBefore(t,n);};
3
Gleap.load("API_KEY");
4
}}();
5
</script>
Copied!
Congrats! You are now all set πŸŽ‰ Report your first bug by using the feedback button

πŸ‘·β€β™‚οΈ onGleapLoaded delegate

Gleap loads asynchronously. If you want to know when Gleap is loaded and ready, you can simply set the following method onGleapLoaded to get notified once the SDK is ready.
With the new snippet, you don't need to wait for Gleap to be fully loaded anymore. Simply call Gleap methods right after adding the script to the head of your website or webapp.
1
<script>
2
// Wait for Gleap to be ready.
3
window.onGleapLoaded = function(Gleap) {
4
Gleap.identify("user_19283", {
5
name: "Franz",
6
7
});
8
};
9
</script>
10
<script>
11
!function(Gleap,e,key){if(Gleap=window.Gleap=[],!Gleap.initialize)if(Gleap.invoked)window.console&&console.error&&console.error('Gleap SDK included twice.');else{for(Gleap.invoked=!0,Gleap.methods=['identify','clearIdentity','attachCustomData','setCustomData','removeCustomData','clearCustomData','registerCustomAction','logEvent','sendSilentBugReport','startFeedbackFlow','open','hide','on','setLanguage'],Gleap.f=function(e){return function(){var a=Array.prototype.slice.call(arguments);return Gleap.push({e,a}),Gleap;};},e=0;e<Gleap.methods.length;e++)key=Gleap.methods[e],Gleap[key]=Gleap.f(key);Gleap.load=function(k){var t=document.createElement('script');t.type='text/javascript',t.async=!0,t.src='https://widget.gleap.io/widget/'+k;var n=document.getElementsByTagName('script')[0];n.parentNode.insertBefore(t,n);};
12
Gleap.load("API_KEY");
13
}}();
14
</script>
Copied!

🀝 Need help?

We are here to help! [email protected]​
Last modified 23h ago