Last active
August 29, 2015 14:05
-
-
Save gaarf/c560769f163b0f823495 to your computer and use it in GitHub Desktop.
CDAPTracker proposed signature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// node.js mode: | |
var CDAPTracker = require('cask-cdaptracker'); | |
var tracker = new CDAPTracker({ | |
endpoint: 'https://somehost.domain.tld/path/foo/bar' | |
}); | |
tracker.track({hello: 'world'}) // it returns a promise | |
.then(function (response) { | |
console.log('the world was tracked!', response) | |
}); | |
//---------------------------------------------- | |
// browser mode: | |
(function(CDAPTracker) { | |
var tracker = new CDAPTracker({ | |
endpoint: 'https://somehost.domain.tld/path/foo/bar' | |
}); | |
document.getElementById("#somebutton").addEventListener('click', function() { | |
tracker.track({foo: 'bar', desc: 'somebutton was clicked'}); | |
}); | |
})(window.CDAPTracker); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment