Skip to main content

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.

Tracker initialization

You need to initialize a tracker instance in order to use the SDK.

Here is an example:

const PianoAnalytics = require('piano-analytics');
const pa = new PianoAnalytics();

pa.setConfigurations({
site: 123456789,
collectDomain: "https://my.collect.domain",
});
pa.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

  • device_screen_width
  • device_screen_height
  • device_display_width
  • device_display_height
  • browser_language
  • browser_language_local
  • previous_url
  • page_url
  • ch_ua