Data Layer API

An API for interacting with the Fanplayr JavaScript library.

Fanplayr's data API is a simple javascript array which can be used to store and send information to the Fanplayr Platform. It can be used alongside the standard Fanplayr integration to track additional information in your store.

Note: The array must be defined and populated with values BEFORE the standard Page tracking snippet is executed.


Tracking additional page properties

In the following example, two additional properties named brand and color are captured along with the standard information Fanplayr tracks for page views.

The special _type property informs Fanplayr that the information should be stored with the page view.

<!-- Before user tracking snippet -->
window.fanplayr_api = [{
  "_type": "",
  "brand": "Super",
  "color": "red"

Last updated