Javascript (browserless)
Our JS browserless SDK aims at being integrated in any application running on Javascript and in an environment different from a browser.
The main difference from the standard JS SDK is that it doesn't call browser APIs (e.g: cookie storage, window dimensions, navigator.sendBeacon(), ...)
In this article, we will explain the specific implementation requirements. Tagging methods and most of the JS SDK features are the same.
Library installation
Install our NPM package:
- NPM
- Yarn
npm install piano-analytics-js --save
yarn add piano-analytics-js
Tracker initialization
You need to initialize a tracker instance in order to use the SDK.
Here is an example:
import { pianoAnalytics } from "piano-analytics-js";
// for commonJS environment you can do the following
// const pianoAnalytics = require('piano-analytics-js').pianoAnalytics;
pianoAnalytics.setConfigurations({
site: 123456789,
collectDomain: "https://my.collect.domain",
});
pianoAnalytics.sendEvent("page.display", {
page: "Page label",
});
Unavailable properties
Since the SDK doesn't use browsers' APIs, here are the properties it can't retrieve automatically
idclientdevice_screen_widthdevice_screen_heightdevice_display_widthdevice_display_heightbrowser_languagebrowser_language_localprevious_urlevent_url_fullch_ua