Answers Search UI - Session Storage (Summer '21 Release)

With the increasing importance of internet privacy, we’ve added even more support for controlling the use of session tracking in an Answers experience.

The Answers Search UI supports a sessionTrackingEnabled boolean, which can be set in the ANSWERS.init, or set via a function, ANSWERS.setSessionsOptIn(true). It passes this boolean to the API in the form of a sessionTrackingEnabled param. By default, sessionTrackingEnabled is true. If true, Answers will try to use session storage and session cookies to store the session ID. If sessionTrackingEnabled is false, Answers will not store any session information.

You can set sessionTrackingEnabled during the integration process when initializing the library. sessionTrackingEnabled is a top-level config option in the ANSWERS.init. If not specified, defaults to true.

    // Required, your Yext Answers API key
    apiKey: '<API_KEY_HERE>',
    // Required, the key used for your Answers experience
    experienceKey: '<EXPERIENCE_KEY_HERE>',
    onReady: function() {},
    // Optional, whether or not to submit user interaction analytics events
    sessionTrackingEnabled: true,
    // Optional*, Yext businessId, *required to send analytics events, should be set if analyticsTrackingEnabled == false
    businessId: 'businessId',

It is also an option in the theme’s global_config.json:

  "sdkVersion": "1.8",
  // "apiKey": "<REPLACE ME>",
  // "experienceVersion": "<REPLACE ME>",
  // "businessId": "<REPLACE ME>",
  "logo": "",
  "favicon": "",
  "googleTagManagerName": "dataLayer",
  "googleTagManagerId": "",
  "googleAnalyticsId": "",
  "conversionTrackingEnabled": true, // Whether or not conversion tracking is enabled for all pages
  "sessionTrackingEnabled": true, // Whether or not session tracking is enabled for all pages
  "analyticsTrackingEnabled": true //Whether or not to submit user interaction analytics events 

Upgrade Implications:
In order to adjust sessionTrackingEnabled, make sure to upgrade to theme 1.23!

:spiral_calendar: This feature is available in Early Access. Here’s how to use the Early Access branches of the Theme and SDK!