Skip to content

apxor/apxor-web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Apxor Web SDK

Install through NPM

npm i -s apxor

Import and initialize SDK in root of your application

import Apxor from 'apxor'; //ES6
//var Apxor = require('apxor'); //ES5

Apxor.init('YOUR_SITE_ID', {
    debug: true //remove this option in production
});

APIs:

import Apxor from 'apxor';
UserId
Apxor.setUserId(String);

Eg:

Apxor.setUserId("[email protected]");

PageView:
Apxor.logPageView(location.pathname); //String URL pathname

Eg:

Apxor.logPageView("/about.html");

Events:
Apxor.logEvent(name, properties, [category]); //All Strings

Eg:

Apxor.logEvent("ADD_TO_CART", {
    "userId": "[email protected]",
    "value": "1299",
    "item": "Sony Head Phone 1201" 
}, "PRODUCT_PURCHASE");

User Properties:
Apxor.setUserProperties({
    "property1": "value",
    "property2": "value2"
});

Eg:

Apxor.setUserProperties({
    "gender": "male",
    "age": "24"
});

Session Properties:
Apxor.setSessionProperties({
    "property1": "value",
    "property2": "value2"
});

Eg:

Apxor.setSessionProperties({
    "language": "en",
    "location": "Hyderabad"
});

About

Apxor Web SDK Core

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published