A standardized interface for event tracking.
Bighorn exposes a simple API for emitting events to multiple backends. Think of it as a poor man's version of segment.io
Bighorn auto-detects backends by checking for their variable names on the global namespace. i.e. window, self
Note: Bighorn formats structured data as KVN when emitting events to some backends to capture the richest dataset possible.
<script type="text/javascript" src="/path/to/bighorn.min.js"></script>
<script type="text/javascript">
Bighorn.track({
name: "click",
type: "affiliate-link",
host: "my-site.com/example",
target: "great-offer.com/example",
value: 7.50,
utm_source: "traffic-source"
});
</script>
Details coming soon...
It's possible to validate with additional JSON schemas.
<script type="text/javascript" src="/path/to/bighorn.min.js"></script>
<script type="text/javascript">
// schema to restrict event names
var nameSchema = {
"properties": {
"name": {
"enum": [
"click",
"mouseup"
]
}
}
};
var eventData = {
name: "click",
type: "affiliate-link",
host: "my-site.com/example",
target: "great-offer.com/example",
value: 7.50,
utm_source: "traffic-source"
};
Bighorn.track(data, nameSchema);
// note: track accepts N-number of additional schemas to validate with
// Bighorn.track(data, nameSchema, otherSchema, extraSchema, ...);
</script>
git clone [email protected]:hopsoft/bighorn.git
cd bighorn
npm install
make
npm test
npm start
open http://localhost:8080/test