How to get (raw) lead data
Speed and loading time
Example
<!-- Load LeadBoxer tracking pixel
-- can be removed if pixel is already loaded using another method -->
<script src="//script.leadboxer.com/?dataset=ee84d5e06e8811e79a2675ee660df0b1"></script>
<!-- Load jQuery
-- can be removed if lib is already loaded using another method -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
// first we add a 3s delay to make sure the lead is created before we can access the details
setTimeout(function(){
// Variables for lead details API
var leadId = ot_uid(); // get current LeadBoxer userID
var site = "ee84d5e06e8811e79a2675ee660df0b1"; // define your datasetID
// Construct url for lead_details API
var url = "https://kibana.leadboxer.com/api/views/lead_detail?email=&leadId=" + leadId + "&site=" + site;
// In this example, we will get the lead details and output the last_city using jQuery to parse the json data
$( document ).ready(function() {
jQuery.ajax({
url: url,
dataType: 'jsonp',
success: function(data) {
last_city = data.resultsList[0].last_city;
console.log(last_city);
}
});
});
}, 3000); // end of timeout function
</script>Last updated
Was this helpful?
