Download and include library in your html
<source src="Epictic.min.js"></source>var tracker = Epic.init("YOUR_URL", "API_KEY");tracker.track("Edit Profile", null);Use shared instance.
Epic.initShared("YOUR_URL", "API_KEY");
Epic.track("Edit Profile", null);Create one instance, or multiple ones with different environments.
var tracker = Epic.init("YOUR_URL", "API_KEY");
var tracker2 = Epic.init("YOUR_URL2", "API_KEY2");
tracker.track("Edit Profile", null);
tracker2.track("Troubleshooting", null);Track event without properties.
tracker.track("Login",null);Track event with properties.
var properties = {
EmailEntered: true,
PasswordEntered: false,
Success: false
}
tracker.track("Login",properties);Register properties once and they will be sent with every request. If you register properties multiple times, properties will be merged in favor of newly added.
var properties = {
Platform: navigator.platform,
Browser: navigator.appName,
BrowserVersion: navigator.appVersion
}
tracker.register(properties);Project released under the MIT license