Thanks to visit codestin.com
Credit goes to github.com

Skip to content

hopsoft/bighorn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bighorn

A standardized interface for event tracking.

Overview

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

Supported Backends

Note: Bighorn formats structured data as KVN when emitting events to some backends to capture the richest dataset possible.

Basic Usage

<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>

Validation

Details coming soon...

Advanced Usage

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>

Setup

git clone [email protected]:hopsoft/bighorn.git
cd bighorn
npm install

Build

make

Test

npm test
npm start
open http://localhost:8080/test

About

A standardized interface for event tracking

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages