Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
// my-gumband-project/manifest.js
export const MANIFEST = {
    manifest: {
        statuses: [...],
        controls: [...],
        settings: [...],
        metrics: [
            {
                interactionTimeoutMs: 15000 // a 15 second timeout
            }
        ]
    }
}

How To Handle Multiple Concurrent Interactions

Some exhibits may have multiple users interacting with it at one time. To handle this scenario, Gumband provides additional methods which specific interaction an event belongs to. These functions mirror the regular create, startInteraction, and endInteraction, and are called createConcurrent, startConcurrentInteraction, and endConcurrentInteraction. The only difference is that these methods take an interactionId and always return the interactionId with which their event will be associated. To start an interaction, simply call either the createConcurrent or startConcurrentInteraction methods without an interactionId and we will generate one for you:

Code Block
languagejs
// 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 exhibitWokenFromIdleState() {
  let interactionId = gb.metrics.createConcurrent('Exhibit Woken', {});
  
  console.log(interactionId);
  // 0357892a-68e0-49cc-bf2d-18a8ca563f68
}

To add more more events to the same interaction, add the returned interactionId on subsequent event calls:

Code Block
languagejs
function contentSelected(interactionId) {
  gb.metrics.createConcurrent('Content Selection', { name: "content" }, interactionId);
}