How to get LeadBoxer data into Intercom
LeadBoxer and Intercom
How to do it?
<!-- Load jQuery -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<!-- Load Intercom -->
<script>
var APP_ID = "YOUR APP ID"; // <-- make sure you update this
window.intercomSettings = {
app_id: APP_ID
};
</script>
<script>(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/APP_ID';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()</script>
<!-- Load LeadBoxer -->
<script src="//script.leadboxer.com/?dataset=ee84d5e06e8811e79a2675ee660df0b1"></script>
<script type="text/javascript">
// Variables for lead_details
var userId = ot_uid(); // define userID
var site = "ee84d5e06e8811e79a2675ee660df0b1"; // your datasetID
// Contruct url for lead_details
var url = "https://kibana.leadboxer.com/api/views/lead_detail?email=&leadId=" + leadId + "&site=" + site;
$( document ).ready(function() {
// In this example, we will get the lead details and output the leadcard URL
jQuery.ajax({
url: url,
dataType: 'jsonp',
success: function(data) {
leadcard_url = data.resultsList[0].leadcard_url;
console.log(leadcard_url);
// Send data to Intercom
Intercom('update', {"leadcard": leadcard_url});
}
});
});
</script>Last updated
Was this helpful?
