tracie
v0.0.5
Published
Event tracking made simple
Downloads
12
Readme
Tracie (client)
Tracie is a self-hosted event tracking service written in NodeJS. This is a client library, used to create events and send them to your hosted server. Supported on either NodeJS and browser enviroment.
Note: Usage on NodeJS and browser is slightly different_
Install and Usage on Browser
On browser, embed the tracie
distribution script, and use
1. Embed distribution script
// Add tracie client
<script src="path/dist/index.min.js" />
// Or using jsdelivr (you can replace `latest` with a version)
<script src="https://cdn.jsdelivr.net/npm/tracie@latest/dist/index.min.js" />
2. Usage
// Initate connection
tc.initiate({ server: "{serverpath}" });
// send event
tc("event_name");
document.onload = function() {
tc("hits")
}
Install and Usage on Webpack (es5, es6, ...)
You'll need to install tracie
and node-fetch
1. Install
# using yarn
$ yarn add tracie node-fetch
# using npm
$ npm install tracie node-fetch --save
2. Usage
// Import using require
const Tracie = require("tracie");
// Or import in ES6
import Tracie from "tracie";
const tc = new Tracie({
server: "{serverpath}"
})
// Add an event
tc.add("event_name");