Skip to content

Instantly share code, notes, and snippets.

@wetzler
Created July 21, 2014 23:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wetzler/58effe995e42e6c31888 to your computer and use it in GitHub Desktop.
Save wetzler/58effe995e42e6c31888 to your computer and use it in GitHub Desktop.
Example of sending an event
<!DOCTYPE html>
<html lang='en'>
<head>
<title>Send Event Test</title>
<script type="text/javascript">
!function(a,b){if(void 0===b[a]){b["_"+a]={},b[a]=function(c){b["_"+a].clients=b["_"+a].clients||{},b["_"+a].clients[c.projectId]=this,this._config=c},b[a].ready=function(c){b["_"+a].ready=b["_"+a].ready||[],b["_"+a].ready.push(c)};for(var c=["addEvent","setGlobalProperties","trackExternalLink","on"],d=0;d<c.length;d++){var e=c[d],f=function(a){return function(){return this["_"+a]=this["_"+a]||[],this["_"+a].push(arguments),this}};b[a].prototype[e]=f(e)}var g=document.createElement("script");g.type="text/javascript",g.async=!0,g.src="https://d26b395fwzu5fz.cloudfront.net/3.0.4/keen.min.js";var h=document.getElementsByTagName("script")[0];h.parentNode.insertBefore(g,h)}}("Keen",this);
</script>
<script>
var logger = new Keen({
projectId: "53cd960936bf5a6b2f000000",
writeKey: "key"
});
// var server = restify.createServer();
request_details = {
servername: "hostmyghost.com",
route: "/routeyay/",
id: 2342353424,
request: "Plz do that thing",
response: 200
}
logger.addEvent("michelle_test", request_details)
</script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment