@toyef/arise-web
v0.3.7
Published
This is a JavaScript library of [Arise analytics](https://ariseapp.com).
Readme
Arise Web
This is a JavaScript library of Arise analytics.
npm i @toyef/arise-webThen initialize it in your code.
import * as arise from '@toyef/arise-web
arise.init();Methods
init
Initializes Arise. No tracking happens before this method is called.
arise.init({
// Token is *required* when tracking subdomains or multiple domains.
token: 'PROJECT TOKEN';
// By default, we track all page views automatically.
// But if you want manual tracking with arise.page(), you can set autoPageView to false.
autoPageView: false;
// Skip tracking of provided pages, wildcard * is supported
skipPatterns: ['/about', '/blog/*'];
// Mask parts of pages that match provided patterns, wildcard * is supported
maskPatterns: ['/customer/*/order/*'];
// Set a first-party cookie only on .setUser() call
cookieOnIdentify: false;
// Set a first-party cookie to every visitor
cookie: false;
});init() options:
token - Token is required when tracking subdomains or multiple domains. You can find your project token in the project settings.
autoPageView - Set to true by default. But if you want manual tracking with arise.page(), you can set autoPageView to false.
skipPatterns - Specify an array of pages or patterns you don't want to be tracked. These can be exact paths, such as /about or /how-it-works, or patterns with a wildcard *, such as ** /blog/* ** or /projects/*/visitors/*.
maskPatterns - Specify an array of pages or patterns you want to mask. This works similarly to skipPatterns, but instead of skipping routes, it masks them and tracks the masked value. Ideal if you want to mask routes with private IDs, like /customer/*/order/*.
cookieOnIdentify - If you're using setUser to track your authorized users, you can set cookieOnIdentify to true to automatically set an ID to visitor's browser as a first-party cookie when you identify them. This ID will be used to track the user's activity across different sessions.
cookie - Set an ID to all visitors as a first-party cookie. This ID will be used to track the user's activity across different sessions.
page
If you set autoPageView to false, you can manually track current page views.
arise.page();track
Track custom events using arise.track(). You can pass event name and custom properties.
arise.track('Order completed', {
delivery: 'DHL',
total: 99.99
});enableAutoPageView
If you loaded the script with autoPageView set to false you can enable it with arise.enableAutoPageView().
arise.enableAutoPageView();setUser
Populates visitors with custom data and creates a Profile. Great for tracking your authorized users.
arise.setUser({
userId: "unique-user-id", // userId is a required field
plan: "enterprise",
credits: 140,
});enableCookieMode
Enables cookie mode and immediately sets a first-party cookie to the visitor's browser.
