...
Gumband metrics is a feature set that allows you to draw meaningful insight as to how users are utilizing your exhibit. Out of the box, we provide a way to measure the number of user interactions and the session duration, and, if needed, we can build additional visualizations based on your bespoke specific use case.
When measuring the engagement of your exhibit we have two basic concepts to understand: “events” and “interactions”.
Events are singular moments in time when something happens on the exhibit, typically due to a user action like a button push. An Interaction is simply a collection of events that occurred within a specific window of time, typically representing a single, complete user experience of the exhibit.
The most minimal approach to using the metrics modules module can be seen below:
Code Block | ||
---|---|---|
| ||
// File: your-code.js const { Gumband } = require('@deeplocal/gumband-nodejs-sdk') // or import { Gumband } from '@deeplocal/gumband-nodejs-sdk' const gb = new Gumband(EXHIBIT_TOKEN, EXHIBIT_ID, PATH_TO_MANIFEST) function handleButtonPress(){ gb.metrics.create("Button Press", {buttonColor: "Blue"}) } |
You get to choose the value of the event name (“Button Press”) and the payload ({buttonColor: "Blue"}
). Once you call this the metrics.create
function, the backend of Gumband will take this and any subsequent events and bucket them into the same interaction. If there is a lapse in events for 60 seconds (the platform default), the backend will time out the interaction. You can take steps to configure the interaction timeout if needed.
An Remember that an event that describes how and when a user is interacting with your exhibit is much more interesting than one that simply describes how your exhibit works. For instance, you would not want to fire an event just because the content changed on a passive screen UNLESS that particular change was triggered by the user.
...
In the above example we used the minimalist approach of starting an interaction only when a user conducts some action. If you need to explicitly start an interaction without a user action you can do so with gb.metrics.startInteraction()
Code Block | ||
---|---|---|
| ||
// File: you-code.js const { Gumband } = require('@deeplocal/gumband-nodejs-sdk'); // or import { Gumband } from '@deeplocal/gumband-nodejs-sdk'; const gb = new Gumband(EXHIBIT_TOKEN, EXHIBIT_ID, PATH_TO_MANIFEST) function explicitlyStartInteractonstartInteractonWithoutUserAction(){ gb.metrics.startInteraction(); // 👈 an arbitrary payload, defaults to {} } function handleButtonPress(){ gb.metrics.create("Button Press", {buttonColor: "Blue"}); } |
How to End an Interaction Before Timeout is Reached
...
Code Block |
---|
// File: Game.js const { Gumband } = require('@deeplocal/gumband-nodejs-sdk'); // or import { Gumband } from '@deeplocal/gumband-nodejs-sdk' const gb = new Gumband(EXHIBIT_TOKEN, EXHIBIT_ID, PATH_TO_MANIFEST); function handleButtonPress(){ gb.metrics.create("Button Press", {buttonColor: "Blue"}); } function endInteractionBeforeTimeoutdocentManuallyResetsExhibit(){ gb.metrics.endInteraction(user); } |
Calling gb.metrics.endInteraction()
will take any interaction that is “open” and will close it, no longer accepting new events. Any subsequent events (either with create()
or startInteraction()
) will open a brand new interaction.
...
Code Block | ||
---|---|---|
| ||
// my-gumband-project/gumband-manifest.json { "manifest": { "statuses": [...], "controls": [...], "settings": [...], "metrics": [ { "interactionTimeoutMs": 15000 // a 15 second timouttimeout } ] } } |