The following javascript is not being executed when I successfully make my api call and assign the status of the api call to a variable.
var Keen=Keen{configure:function(e){this.cf=e},addEvent:function(e,t,n,i){this.eq=this.eq[],this.eq.push([e,t,n,i])},setGlobalProperties:function(e){this.gp=e},onChartsReady:function(e){this.ocrq=this.ocrq||[],this.ocrq.push(e)}};(function(){var e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src=("https:"==document.location.protocol?"[url=https://":"http://")+"dc8na2hxrj29i.cloudfront.net/code/keen-2.1.0-min.js"var]https://":"http://")+"dc8na2hxrj29i.c...[/url] t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)})();
Code: Select all
// Configure the Keen object with your Project ID and (optional) access keys.
Keen.configure({
projectId: localStorage.getItem("keen_project_id"),
writeKey: localStorage.getItem("keen_write_id") // required for sending events
}); // create an event as a JS object
var ticket = {
page: "create_maintenance_request",
tntID: localStorage.getItem('tntID')
};
// add event to "maintenance_tickets" collection
Keen.addEvent("maintenance_tickets", ticket);