Skip to content
  • There are no suggestions because the search field is empty.

SignMetrix BrightSign Javascript Project Integration

The SignMetrix system provides analysis tools for your digital signs. This analytics system tracks events and triggers in your BrightAuthor presentation, allowing you to monitor how your sign is performing at the endpoint. This is a very customizable system, allowing you to choose what events you want to post to the SignMetrix system. Example events include touch screen product selectors or the time duration a person interacts with your sign.

Quickstart Guide
Version 1.0

 

Configuring the SignMetrix System

Follow the steps below to configure your SignMetrix analytics account for a BrightSign player.

STEP 1

Sign into your SignMetrix system and select ‘Licenses’.

STEP 2

In the licenses dialog, select and copy (Ctrl-C) your License Code. This code will be used to post events to the SignMetrix system automatically.

STEP 3

Click on Stores in the left panel. This will bring you to the Stores list. You will see your BrightSign players in the list. You can edit the details of each Store or Stand by selecting the Store or Stand and editing the options on the right panel.

Adding SignMetrix to your JSON Project

The SignMetrix software lets you track any event or trigger. Obviously, you probably don’t want to track all events, so determine which events you would like to track, i.e. a touch event for a product.

var scriptVersion; // "PROVIDED BY CUSTOMER";

var timezone; // "USE UNDEFINED FOR THE FIRST POST. THEN TAKE timezone FROM THE RESPONSE OF FEEDEVENT API POST AND USE timezone AFTERWARDS.";

var licenceCode; // "PROVIDED BY CUSTOMER";

var eventType; // "USE 'TOUCH' or 'PICKSTART' or 'PICKEND'";

var productName; // "PRODUCT NAME";

var durationMs = 0; // "0 IF TOUCH. OTHERWISE DURATION IN MILLISECONDS BETWEEN PICKSTART AND PICKEND EVENTS. POSITIVE NUMBER.";


function createMessage() {

vardeviceInfo=newBSDeviceInfo();

varmsg= {

requestId: uuidv4(),

deviceIdentity: deviceInfo.deviceUniqueId,

deviceManufacturer: "BRIGHTSIGN",

deviceModel: deviceInfo.model,

deviceOs: "Brightsign OS",

deviceOsVersion: deviceInfo.version,

appName: "SIGNMETRIXBSPLUGIN",

appVersion: scriptVersion,

timezone: timezone,

licenceCode: licenceCode,

eventParams: [],

action: eventType,

product: productName,

durationMs: durationMs,

};

return msg;

}



function uuidv4() {

try {

returncrypto.randomUUID();

} catch (error) {

try {

return"10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) => (+c ^ (crypto.getRandomValues(newUint8Array(1))[0] & (15>> (+c /4)))).toString(16));

} catch (error) {}

}

return"";

}



function postMessage(message) {

varmyHeaders=newHeaders();

myHeaders.append("Content-Type", "application/json");



varraw= message;

varrequestOptions= {

method: "POST",

headers: myHeaders,

body: raw,

redirect: "follow",

};



fetch("https://app.picknwatch.com/PnwServer/services/rs/tp/v1/feed/event", requestOptions)

.then((response) => {

varresponseStatus=response.status;



if (responseStatus ==401) {

console.log("[postMessage] Unauthorized feed event sent.");

return undefined;

}

if (!response.ok) {

console.log("[postMessage] Feed event is not successful. html status:"+ responseStatus);

response.text().then((error) => {

if (error) console.log("[postMessage] Error message:"+ error);

});

return undefined;

}

returnresponse.text();

})

.then((result) => {

processFeedEventResponse(result);

})

.catch((error) => console.log("error", error));

}

function processFeedEventResponse(responseText) {

if (!responseText) return;



try {

console.log("[processFeedEventResponse] "+ responseText);

varresponseTextJson=JSON.parse(responseText);

if (responseTextJson) {

timezone = responseTextJson.timezone;

}

console.log("[processFeedEventResponse] timezone parsed:"+ timezone);

} catch (e) {

console.error("[processFeedEventResponse] error:"+ e);

}

}

SignMetrix Real-time Data

Once your player is running your new Project and is connected to the web, event data will be posted to your SignMetrix Account.

STEP 1

Sign in to your SignMetrix account

STEP 2

Click Dashboard.

STEP 3

The SignMetrix plugin events in your presentation will automatically increment on the dashboard screen. Product names will be incremented and created if they are not present. 

STEP 4

Use the SignMetrix tools to view your data