Quick Start

Getting started with Asayer is straightforward. There are 2 ways you can get Asayer up and running: using the script or the npm package.

Using Asayer Script

Copy/paste the code snippet directly into the </head> of your web app or using a tag manager (i.e. Google Tag Manager). The script can be found in Asayer dashboard under Preferences > Projects and is unique to each project.

Using Asayer NPM

Installation

npm i @asayerio/tracker --save

Usage

Initialize the package from your codebase entry point and start the tracker. You must set the projectID option in the constructor. Its value can can be found in your Asayer dashboard under Preferences > Projects.

import Tracker from '@asayerio/tracker';
const tracker = new Tracker({
projectID: PROJECT_ID
});
tracker.start();

User Identification

You can then use Asayer JavaScript anywhere in your code. Use userID method to identify your users when recording a session. Check our API documentation for the list of available methods.

tracker.userID('john@doe.com');

Options and Methods

Check JavaScript SDK for the list of available options and methods.