Use Storyteller.sharedInstance.eventTrackingOptions to apply your users'
privacy and consent choices. Each option turns off one kind of tracking or
storage. Set the options before you call initialize, so the SDK follows them
from its first request. You can assign new options at any time, for example
when a user changes their consent.
disabledFunctionalFeatures accepts an array of the following
StorytellerTrackedFunctionalFeature values. In a script tag, pass the string
values, for example ['pollVotes']. The StorytellerTrackedFunctionalFeature
enum is available only from the npm package.
Item name
Description
all
Disables all of the options below.
clipLikes
Disables Clip like tracking. If a user likes a Clip, the UI updates, but if they swipe away and come back to that Clip, it appears unliked again.
clipShares
Disables Clip share tracking. If a user shares a Clip, the UI updates, but if they swipe away and come back to that Clip, the share count returns to its value before the user shared it.
clipViewedStatus
Disables Clip viewed tracking, and all Clips appear as not viewed. The SDK also stops sending the IDs of recently viewed Clips with Clips requests.
pageReadStatus
Disables Story read tracking, and all Stories appear as unread.
pollVotes
Disables Poll vote tracking. If a user votes in a Poll, the UI updates, but when they go to another Page and come back, they can vote in the Poll again.
triviaQuizAnswers
Disables Quiz answer tracking and hides the results Page. If a user answers a Quiz question, the UI updates, but when they go to another Page and come back, they can answer it again.
When enableFullVideoAnalytics is true, events sent to the
onUserActivityOccurred callback include detailed video information, such as
Story titles, Clip titles, Story IDs, and Clip IDs.
When it is false, the SDK sets these fields to null for Video Privacy
Protection Act (VPPA) compliance:
storyId, storyTitle, storyDisplayTitle
clipId, clipTitle
pageId, pageTitle
This lets you comply with video privacy regulations and still receive
engagement events. All other event data, such as user interactions, durations,
and event types, is still included.
turn off Storyteller analytics, except the events listed in
Storyteller tracking
stop storing non-essential items in local storage, and remove the ones the
SDK stored before
The table below lists every item the SDK stores in the browser's local storage.
The SDK stores items marked Always stored even when
enableFunctionalCookies is false, because it needs them to work. For
example, Stories run in iframes, and the Story player and Story Pages share
data through these items.
Item name
Description
User data?
Always stored?
Storyteller.apiKey
The API key passed to initialize.
No
Yes
Storyteller.captionsEnabled
The user's caption choice, shared by Stories and Clips.
Yes
No
Storyteller.clipShares
Share counts for the Clips loaded on the page, including the user's own shares.
Yes
No
Storyteller.customInstanceHost
A custom Storyteller API host, when your integration sets one.
No
Yes
Storyteller.environment
The Storyteller API environment that the SDK uses.
No
No
Storyteller.forceShowShareButton
A Storyteller testing flag. The SDK sets it to false when the user changes.
No
No
Storyteller.hasShownInstructions
Whether the user has seen the instructions screen.
Yes
No
Storyteller.likes
The Clips the user liked. Stored only when enableRemoteViewingStore is false.
Yes
No
Storyteller.pollAnswers
The user's Poll answers. Stored only when enableRemoteViewingStore is false.
Yes
No
Storyteller.polls
Poll data for the Stories loaded on the page.
No
Yes
Storyteller.quizAnsweredCorrectlyMap
The user's Quiz scores, used to show their results.
Yes
Yes
Storyteller.quizzes
Quiz data for the Stories loaded on the page.
No
Yes
Storyteller.readPages
The Story Pages the user has read. Stored only when enableRemoteViewingStore is false.
Yes
No
Storyteller.recentStoryPlaybackMode
The analytics storyPlaybackMode value for each recently opened Story.
Yes
No
Storyteller.settings
Your tenant settings for the API key.
No
Yes
Storyteller.triviaQuizAnswers
The user's Quiz answers. Stored only when enableRemoteViewingStore is false.
Yes
No
Storyteller.user
The hashed user ID. The SDK creates an anonymous ID or hashes the externalId passed to initialize. Not stored when enableRemoteViewingStore is false.
Yes
No
Storyteller.userAttributesStorage
The user attributes set with setUserAttribute and setLocale.
Yes
No
Storyteller.viewedClips
The Clips the user has viewed. Stored only when enableRemoteViewingStore is false.
Yes
No
Versions before 10.11.0 stored an unhashed user ID in Storyteller.userId.
The SDK removes that item when it saves Storyteller.user.
Version 11.0 renamed the items that hold viewing history. The SDK doesn't read
the old items and doesn't remove them, even when enableFunctionalCookies is
false. If your consent manager or cleanup script lists Storyteller items, add
the new names. Remove the old items yourself if your consent policy requires
it.
By default, the SDK includes user attributes and the user ID in requests to
Storyteller, so Storyteller can personalize the content it returns. Set
enablePersonalization to false to turn off personalization. The SDK then
removes the stored user attributes and doesn't store new ones. Viewing history
still loads, because it follows the
remote viewing store option.
The Storyteller Web Showcase's persistAndApplyAttributeValues
helper shows how to store user attributes and apply them before they affect
personalization.
Warning
Personalization is always off when enableFunctionalCookies is false,
because the SDK doesn't store user IDs.
When enableRemoteViewingStore is true (the default), Storyteller keeps the
user's viewing history: read Pages, Clip likes and views, and Poll and Quiz
answers. initialize loads the history for the current user ID, and the SDK
doesn't keep it in local storage. See
Identify and personalize users.
Loading the history also needs enableFunctionalCookies. If it is false
while this option is true, the SDK doesn't load the history, and it keeps the
user's viewing state in memory only until the page reloads. The history request
does not depend on enablePersonalization, and it never includes user
attributes.
When enableRemoteViewingStore is false, the SDK never stores user IDs or
sends them to Storyteller, and it keeps all viewing activity in local storage
on the device. This privacy-enhanced mode is designed to address Video Privacy
Protection Act (VPPA) compliance concerns.
By default, the SDK records analytics events on Storyteller's servers. Set
enableStorytellerTracking to false to turn off Storyteller analytics. The
SDK still sends a few events that it needs to work, but Storyteller doesn't
store them: openedPage, votedPoll, triviaQuizQuestionAnswered,
openedClip, likedClip, and unlikedClip. The SDK doesn't send one of these
events when you disable the matching
functional feature, for example votedPoll
when pollVotes is disabled.
When Storyteller analytics are on, initialize also sends an
sdkInitialized event. It includes the page
origin and path, the browser viewport size, device and operating system
details, and the tracking options.
Warning
Storyteller tracking is always off when enableFunctionalCookies is
false. The SDK still sends the events listed above, without a user ID.
Set enableUserActivityTracking to false to stop calls to the
onUserActivityOccurred callback. Your site uses this callback to record
Storyteller events in its own analytics. See Integrate analytics.
A view's optional context value returns through this
client callback when user activity tracking is enabled. The SDK excludes it
from Storyteller analytics API requests. Your application owns the value and
any transfer to another analytics provider. Keep credentials and personal data
out of this field.
{"slug": "privacy-and-tracking", "page_title": "Control Privacy and Tracking", "page_url": "PrivacyAndTracking/", "canonical_url": "/web/PrivacyAndTracking/", "markdown": "# Control privacy and tracking\n\n<!-- markdownlint-disable MD033 -->\n<span id=\"privacy-and-tracking\"><\/span>\n<!-- markdownlint-enable MD033 -->\n\nUse `Storyteller.sharedInstance.eventTrackingOptions` to apply your users'\nprivacy and consent choices. Each option turns off one kind of tracking or\nstorage. Set the options before you call `initialize`, so the SDK follows them\nfrom its first request. You can assign new options at any time, for example\nwhen a user changes their consent.\n\n=== \"JavaScript\"\n\n ```javascript\n Storyteller.sharedInstance.eventTrackingOptions = {\n disabledFunctionalFeatures: ['all'],\n enableAdTracking: false,\n enableFullVideoAnalytics: false,\n enableFunctionalCookies: false,\n enablePersonalization: false,\n enableRemoteViewingStore: false,\n enableStorytellerTracking: false,\n enableUserActivityTracking: false,\n };\n ```\n\n=== \"TypeScript\"\n\n ```typescript\n import * as Storyteller from '@getstoryteller/storyteller-sdk-javascript';\n import {\n StorytellerTrackedFunctionalFeature,\n type StorytellerEventTrackingOptions,\n } from '@getstoryteller/storyteller-sdk-javascript';\n\n const eventTrackingOptions: StorytellerEventTrackingOptions = {\n disabledFunctionalFeatures: [StorytellerTrackedFunctionalFeature.all],\n enableAdTracking: false,\n enableFullVideoAnalytics: false,\n enableFunctionalCookies: false,\n enablePersonalization: false,\n enableRemoteViewingStore: false,\n enableStorytellerTracking: false,\n enableUserActivityTracking: false,\n };\n\n Storyteller.sharedInstance.eventTrackingOptions = eventTrackingOptions;\n ```\n\nBy default, `disabledFunctionalFeatures` is an empty array and every other\noption is `true`.\n\nEach assignment replaces all options. An option you leave out returns to its\ndefault, so pass every option each time.\n\n## Disabled functional features\n\n`disabledFunctionalFeatures` accepts an array of the following\n`StorytellerTrackedFunctionalFeature` values. In a script tag, pass the string\nvalues, for example `['pollVotes']`. The `StorytellerTrackedFunctionalFeature`\nenum is available only from the npm package.\n\n| Item name | Description |\n| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `all` | Disables all of the options below. |\n| `clipLikes` | Disables Clip like tracking. If a user likes a Clip, the UI updates, but if they swipe away and come back to that Clip, it appears unliked again. |\n| `clipShares` | Disables Clip share tracking. If a user shares a Clip, the UI updates, but if they swipe away and come back to that Clip, the share count returns to its value before the user shared it. |\n| `clipViewedStatus` | Disables Clip viewed tracking, and all Clips appear as not viewed. The SDK also stops sending the IDs of recently viewed Clips with Clips requests. |\n| `pageReadStatus` | Disables Story read tracking, and all Stories appear as unread. |\n| `pollVotes` | Disables Poll vote tracking. If a user votes in a Poll, the UI updates, but when they go to another Page and come back, they can vote in the Poll again. |\n| `triviaQuizAnswers` | Disables Quiz answer tracking and hides the results Page. If a user answers a Quiz question, the UI updates, but when they go to another Page and come back, they can answer it again. |\n\n## Ad tracking\n\nSet `enableAdTracking` to `false` to:\n\n- stop sending ad events to Storyteller analytics\n- leave ad events out of the `onUserActivityOccurred` callback\n- leave information about the current Story or Clip out of ad requests\n- leave the `publisherProvidedId` that your `getAdConfig` callback returns out\n of ad requests\n\nThe `customTargeting` values that your `getAdConfig` callback returns are still\nsent. Leave them out yourself when a user opts out of ad tracking.\n\n## Full video analytics\n\nWhen `enableFullVideoAnalytics` is `true`, events sent to the\n`onUserActivityOccurred` callback include detailed video information, such as\nStory titles, Clip titles, Story IDs, and Clip IDs.\n\nWhen it is `false`, the SDK sets these fields to `null` for Video Privacy\nProtection Act (VPPA) compliance:\n\n- `storyId`, `storyTitle`, `storyDisplayTitle`\n- `clipId`, `clipTitle`\n- `pageId`, `pageTitle`\n\nThis lets you comply with video privacy regulations and still receive\nengagement events. All other event data, such as user interactions, durations,\nand event types, is still included.\n\n## Functional cookies and local storage items\n\nSet `enableFunctionalCookies` to `false` to:\n\n- turn off read status tracking\n- stop storing user IDs\n- turn off Storyteller analytics, except the events listed in\n [Storyteller tracking](#storyteller-tracking)\n- stop storing non-essential items in local storage, and remove the ones the\n SDK stored before\n\nThe table below lists every item the SDK stores in the browser's local storage.\nThe SDK stores items marked **Always stored** even when\n`enableFunctionalCookies` is `false`, because it needs them to work. For\nexample, Stories run in iframes, and the Story player and Story Pages share\ndata through these items.\n\n| Item name | Description | User data? | Always stored? |\n| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | -------------- |\n| `Storyteller.apiKey` | The API key passed to `initialize`. | No | Yes |\n| `Storyteller.captionsEnabled` | The user's caption choice, shared by Stories and Clips. | Yes | No |\n| `Storyteller.clipShares` | Share counts for the Clips loaded on the page, including the user's own shares. | Yes | No |\n| `Storyteller.customInstanceHost` | A custom Storyteller API host, when your integration sets one. | No | Yes |\n| `Storyteller.environment` | The Storyteller API environment that the SDK uses. | No | No |\n| `Storyteller.forceShowShareButton` | A Storyteller testing flag. The SDK sets it to `false` when the user changes. | No | No |\n| `Storyteller.hasShownInstructions` | Whether the user has seen the instructions screen. | Yes | No |\n| `Storyteller.likes` | The Clips the user liked. Stored only when `enableRemoteViewingStore` is `false`. | Yes | No |\n| `Storyteller.pollAnswers` | The user's Poll answers. Stored only when `enableRemoteViewingStore` is `false`. | Yes | No |\n| `Storyteller.polls` | Poll data for the Stories loaded on the page. | No | Yes |\n| `Storyteller.quizAnsweredCorrectlyMap` | The user's Quiz scores, used to show their results. | Yes | Yes |\n| `Storyteller.quizzes` | Quiz data for the Stories loaded on the page. | No | Yes |\n| `Storyteller.readPages` | The Story Pages the user has read. Stored only when `enableRemoteViewingStore` is `false`. | Yes | No |\n| `Storyteller.recentStoryPlaybackMode` | The analytics `storyPlaybackMode` value for each recently opened Story. | Yes | No |\n| `Storyteller.settings` | Your tenant settings for the API key. | No | Yes |\n| `Storyteller.triviaQuizAnswers` | The user's Quiz answers. Stored only when `enableRemoteViewingStore` is `false`. | Yes | No |\n| `Storyteller.user` | The hashed user ID. The SDK creates an anonymous ID or hashes the `externalId` passed to `initialize`. Not stored when `enableRemoteViewingStore` is `false`. | Yes | No |\n| `Storyteller.userAttributesStorage` | The user attributes set with `setUserAttribute` and `setLocale`. | Yes | No |\n| `Storyteller.viewedClips` | The Clips the user has viewed. Stored only when `enableRemoteViewingStore` is `false`. | Yes | No |\n\nVersions before 10.11.0 stored an unhashed user ID in `Storyteller.userId`.\nThe SDK removes that item when it saves `Storyteller.user`.\n\n### Keys renamed in 11.0\n\nVersion 11.0 renamed the items that hold viewing history. The SDK doesn't read\nthe old items and doesn't remove them, even when `enableFunctionalCookies` is\n`false`. If your consent manager or cleanup script lists Storyteller items, add\nthe new names. Remove the old items yourself if your consent policy requires\nit.\n\n| Version 10.13 item | Version 11.0 item |\n| ---------------------------- | ------------------------------- |\n| `Storyteller.clipLikes` | `Storyteller.likes` |\n| `Storyteller.clipsViewed` | `Storyteller.viewedClips` |\n| `Storyteller.pollAnswerMap` | `Storyteller.pollAnswers` |\n| `Storyteller.quizAnswerMap` | `Storyteller.triviaQuizAnswers` |\n| `Storyteller.storiesReadMap` | `Storyteller.readPages` |\n\nSee [Local storage keys changed](getting-started/migrate-to-11.md#local-storage-keys-changed)\nin the migration guide.\n\n## User personalization\n\nBy default, the SDK includes user attributes and the user ID in requests to\nStoryteller, so Storyteller can personalize the content it returns. Set\n`enablePersonalization` to `false` to turn off personalization. The SDK then\nremoves the stored user attributes and doesn't store new ones. Viewing history\nstill loads, because it follows the\n[remote viewing store](#remote-viewing-store) option.\n\nThe Storyteller Web Showcase's [`persistAndApplyAttributeValues`](https://github.com/getstoryteller/storyteller-showcase-web/blob/11.0.0/nextjs/src/components/pages/showcase/account/accountPersistence.ts#L16)\nhelper shows how to store user attributes and apply them before they affect\npersonalization.\n\n!!! warning\n\n Personalization is always off when `enableFunctionalCookies` is `false`,\n because the SDK doesn't store user IDs.\n\n## Remote viewing store\n\nWhen `enableRemoteViewingStore` is `true` (the default), Storyteller keeps the\nuser's viewing history: read Pages, Clip likes and views, and Poll and Quiz\nanswers. `initialize` loads the history for the current user ID, and the SDK\ndoesn't keep it in local storage. See\n[Identify and personalize users](Users.md#setting-a-user-id).\n\nLoading the history also needs `enableFunctionalCookies`. If it is `false`\nwhile this option is `true`, the SDK doesn't load the history, and it keeps the\nuser's viewing state in memory only until the page reloads. The history request\ndoes not depend on `enablePersonalization`, and it never includes user\nattributes.\n\nWhen `enableRemoteViewingStore` is `false`, the SDK never stores user IDs or\nsends them to Storyteller, and it keeps all viewing activity in local storage\non the device. This privacy-enhanced mode is designed to address Video Privacy\nProtection Act (VPPA) compliance concerns.\n\n## Storyteller tracking\n\nBy default, the SDK records analytics events on Storyteller's servers. Set\n`enableStorytellerTracking` to `false` to turn off Storyteller analytics. The\nSDK still sends a few events that it needs to work, but Storyteller doesn't\nstore them: `openedPage`, `votedPoll`, `triviaQuizQuestionAnswered`,\n`openedClip`, `likedClip`, and `unlikedClip`. The SDK doesn't send one of these\nevents when you disable the matching\n[functional feature](#disabled-functional-features), for example `votedPoll`\nwhen `pollVotes` is disabled.\n\nWhen Storyteller analytics are on, `initialize` also sends an\n[`sdkInitialized`](Analytics.md#sdk-initialization) event. It includes the page\norigin and path, the browser viewport size, device and operating system\ndetails, and the tracking options.\n\n!!! warning\n\n Storyteller tracking is always off when `enableFunctionalCookies` is\n `false`. The SDK still sends the events listed above, without a user ID.\n\n## User Activity tracking\n\nSet `enableUserActivityTracking` to `false` to stop calls to the\n`onUserActivityOccurred` callback. Your site uses this callback to record\nStoryteller events in its own analytics. See [Integrate analytics](Analytics.md).\n\nA view's optional [`context`](Analytics.md#context) value returns through this\nclient callback when user activity tracking is enabled. The SDK excludes it\nfrom Storyteller analytics API requests. Your application owns the value and\nany transfer to another analytics provider. Keep credentials and personal data\nout of this field.\n", "copy_markdown_include_header": false, "base_path": "", "ai_dir": "ai", "missing_payload_behavior": "empty"}