Skip to content

Analytics#

Table of Contents#

  1. Overview
  2. Listening to Events
  3. Event Types
  4. Cross-cutting Events
  5. Story Events
  6. Clip Events
  7. Card Events
  8. Ad Events
  9. Organic Watch-time Events
  10. Playback Events
  11. Sheet Events
  12. Search Events
  13. Event Data

Overview#

The Storyteller SDK fires analytics events for various user interactions. You can subscribe to these events to track user engagement, forward analytics to your own systems, or implement custom behavior based on user actions.

Listening to Events#

Subscribe before mounting Storyteller content, retain the subscription, and cancel it when its owning service or widget is disposed. Events are live; the stream does not replay interactions that occurred before the listener.

To receive analytics events, subscribe to the onUserActivityOccurred stream provided by the SDK:

import 'package:storyteller_sdk/storyteller_sdk.dart';

// Subscribe to all user activity events
Storyteller.onUserActivityOccurred.listen((event) {
  print('Event Type: ${event.type}');
  print('Story ID: ${event.data.storyId}');
  print('Story Title: ${event.data.storyTitle}');

  // Forward to your analytics system
  // Pass a map to your analytics provider, for example:
  // analytics.track(event.type, event.data.fields);
});

Each event is a StorytellerUserActivityEvent containing:

  • type - The event type as a String (e.g., 'openedStory', 'completedPage')
  • data - A StorytellerUserActivityData object with detailed information about the event

type is the unmodified native string, and data.fields contains the complete payload delivered to Dart by the platform bridge. Typed Dart properties are conveniences for known fields; preserve the raw values when forwarding analytics so delivered keys without a typed Flutter property remain usable.

For more information on implementing event streams, see the Storyteller Delegate page.

Need a production-ready listener example? The Showcase service wires this stream (and others) in StorytellerService._setupEventListeners.

Event Types#

Use the exact native wire strings below when comparing event.type; Flutter does not rename them. For example, the Opened Story heading corresponds to openedStory. Shared action/share event names apply to Stories and Clips; use the delivered Story/Clip fields to identify their context.

This guide describes Flutter integration behavior. The governed cross-platform Analytics reference is maintained separately and its publication is independent of an SDK release. Event availability depends on the package/native versions; see the Changelog before adopting Unreleased events.

In the discussion below, completing a Page means allowing its playback/timer to finish: the configured duration for an image Page or the playback duration for a video. Do not assume a fixed 15-second image duration.

Cross-cutting Events#

Tile Visible#

Event Type: tileVisible

This event is emitted when a Story or Clip list tile becomes visible through an initial render, scrolling, or a true list reload/data refresh. tileIndex is the one-based visible tile position. The optional context map carries the integrator context associated with the list. Android may additionally supply originalPosition and displayPosition for reordered lists.

Storyteller.onUserActivityOccurred.listen((event) {
  if (event.type == 'tileVisible') {
    print('Tile ${event.data.tileIndex}: ${event.data.context}');
  }
});

SDK Initialized#

sdkInitialized is internal Storyteller telemetry. Android and iOS exclude it from customer analytics callbacks, so it does not arrive through onUserActivityOccurred. Use the result returned by await Storyteller.initialize(...) to check initialization success. The SDK Initialization Fields retained on the Dart data type do not change this delivery rule.

Unsupported and Future Events#

Android declares unsupported, and the native SDK may emit a newer event name that is not listed on this page. Flutter deliberately retains that string in event.type, so no Dart enum update is required to receive it. Every key delivered by the platform bridge is retained in event.data.fields. iOS's Codable bridge naturally includes newly encoded keys; Android native payload additions still require the Flutter Android mapper to be updated during the corresponding native SDK bump.

Story Events#

The following properties may be included in Story-related events:

  • airplayEnabled
  • captionsEnabled
  • contentLength
  • currentCategory
  • eyebrow
  • metadata
  • pageActionText
  • pageActionType
  • pageActionUrl
  • actionLinkId
  • pageHasAction
  • pageId
  • pageIndex
  • pageTitle
  • pageType
  • storyDisplayTitle
  • storyId
  • storyPageCount
  • storyPlaybackMode
  • storyTitle

Opened Story#

Event Type: openedStory

This event is recorded in the following scenarios:

  • When a user taps on a row item to open a story
  • When a story is loaded because the previous Story finished
  • When a story is loaded because the user tapped to skip the last page of the previous story
  • When a user swipes left on a story to go to the next story
  • When a user swipes right on a story to go to the previous story
  • When a user is sent directly to a story via a deep link

Whenever an Opened Story event occurs, additional event data specific to this event includes storyReadStatus, categories, categoryDetails, storyIndex, and openedReason.

Example:

Storyteller.onUserActivityOccurred.listen((event) {
  if (event.type == 'openedStory') {
    print('Story opened: ${event.data.storyTitle}');
    print('Read status: ${event.data.storyReadStatus}');
    print('Opened reason: ${event.data.openedReason}');
  }
});

Opened Page#

Event Type: openedPage

This event is recorded whenever a user views content from a page.

openedPage identifies a Page being opened, including image and interactive Pages. It does not by itself prove that video playback started; use mediaStarted for the native playback-start signal.

Whenever an Opened Page event occurs, additional event data specific to this event includes openedReason.

Dismissed Story#

Event Type: dismissedStory

This event is recorded in the following scenarios:

  • When a user taps the close button to dismiss the story
  • When a user swipes down to dismiss the story
  • When a user taps to skip the last page of the final story - this dismisses the story and exits the story view
  • When a user swipes left on the final story to dismiss the story
  • When a user swipes right on the first story to dismiss the story
  • When a user completes the final page of the final story and the story view is dismissed

Whenever a Dismissed Story event occurs, additional event data specific to this event includes dismissedReason, durationViewed, and pagesViewedCount.

Skipped Story#

Event Type: skippedStory

This event is recorded when:

  • a user swipes left to go to the next story
  • a user skips the last page of a story to go to the next story

Skipped Page#

Event Type: skippedPage

This event is recorded when a user taps to go to the next page before completing the current page.

Completed Story#

Event Type: completedStory

This event is recorded at the same time as openedPage for the final page in a story.

Completed Page#

Event Type: completedPage

This event is recorded when a user watches a page to completion (i.e. the timer for that page finishes.)

Action Button Tapped#

Event Type: actionButtonTapped

This event is recorded when a user taps an action button on a page to open a link.

Whenever an Action Button Tapped event occurs, additional event data specific to this event includes actionText.

Share Button Tapped#

Event Type: shareButtonTapped

This event is recorded when a user taps the share button on a page.

Whenever a Share Button Tapped event occurs, additional event data specific to this event includes shareMethod.

Previous Story#

Event Type: previousStory

This event is recorded when:

  • a user swipes right to go to the previous story (unless this is the first story - in which case dismissedStory is fired instead)
  • a user taps back on the first page in a story (and this is not the first page in the first story)

Previous Page#

Event Type: previousPage

This event is recorded when a user taps back to go to a previous page in the story.

Share Success#

Event Type: shareSuccess

This event is recorded when a user selects a sharing method from the system dialog.

Whenever a Share Success event occurs, additional event data specific to this event includes shareMethod.

Voted Poll#

Event Type: votedPoll

This event is recorded when user votes in a poll.

Whenever a Voted Poll event occurs, additional event data specific to this event includes pollAnswerId.

Trivia Quiz Question Answered#

Event Type: triviaQuizQuestionAnswered

This event is recorded when a user answers a question in a trivia quiz.

Whenever a Trivia Quiz Question Answered event occurs, additional event data specific to this event includes triviaQuizId, triviaQuizTitle, triviaQuizQuestionId, and triviaQuizAnswerId.

Trivia Quiz Completed#

Event Type: triviaQuizCompleted

This event is recorded when a user completes a trivia quiz.

Whenever a Trivia Quiz Completed event occurs, additional event data specific to this event includes triviaQuizId, triviaQuizTitle, and triviaQuizScore.

Story Instructions Screen Viewed#

Event Type: storyInstructionsScreenViewed (iOS), storyInstructionScreenViewed (Android)

This event is recorded when:

  • The Story instruction screen appears to users

Whenever a Story Instructions Screen Viewed event occurs, additional event data specific to this event includes storyReadStatus and openedReason.

Clip Events#

The following properties may be included in Clip-related events:

  • airplayEnabled
  • captionsEnabled
  • categories
  • categoryDetails
  • clipActionText
  • clipActionType
  • clipActionUrl
  • actionLinkId
  • collectionClipCount
  • clipFeedType
  • clipHasAction
  • clipHasSecondaryActions
  • clipId
  • clipIndex
  • clipSecondaryActionTypes
  • clipSecondaryActionUrls
  • clipSecondaryActionsText
  • clipTitle
  • contentLength
  • isLive
  • metadata

The following additional properties may be included when available:

  • eyebrow
  • collection
  • collectionTitle
  • categoryId
  • categoryName

Opened Clip#

Event Type: openedClip

This event is recorded when:

  • a user taps on a row or grid item to open a clip
  • a user swipes up to the next clip
  • a user swipes down to the previous clip
  • a user is sent directly to a clip via a call to openCollection
  • a user is sent directly to a clip via a deep link
  • a user opens a Category and navigates to a new Clip or moves back to a previous Category
  • a user dismisses the last Category (by pressing back or swiping right) and returns to the top-level Collection
  • a user opens embedded Clips for the first time
  • a user pulls to refresh at the top of Embedded Clips
  • a user is viewing a Collection with "For You/Following" enabled and switches between "For You" and "Following"

Whenever an Opened Clip event occurs, additional event data specific to this event includes openedReason.

Example:

Storyteller.onUserActivityOccurred.listen((event) {
  if (event.type == 'openedClip') {
    print('Clip opened: ${event.data.clipTitle}');
    print('Clip ID: ${event.data.clipId}');
    print('Collection: ${event.data.collection}');
  }
});

Dismissed Clip#

Event Type: dismissedClip

This event is recorded when:

  • a user taps on the back button in the top-left to exit the Clips player (and is at the top of the stack of Clip Categories)

This event does not fire when the user is not at the top of the Clip Category stack. Whenever a Dismissed Clip event occurs, additional event data specific to this event includes dismissedReason, durationViewed, clipsViewed, and loopsViewed.

Next Clip#

Event Type: nextClip

This event is recorded when:

  • a user swipes up to go to the next clip

Previous Clip#

Event Type: previousClip

This event is recorded when:

  • a user swipes down to go to the previous clip

Completed Loop#

Event Type: completedLoop

This event is recorded when:

  • a user completes a loop of a clip

Whenever a Completed Loop event occurs, additional event data specific to this event includes completionType.

Note: For live clips this event will never be fired.

Action Button Tapped#

Event Type: actionButtonTapped

This event is recorded when:

  • a user taps the primary action button at the bottom of a Clip
  • a user taps any secondary action buttons above the clip title
  • a user swipes left on a clip to open the relevant action

Whenever an Action Button Tapped event occurs, additional event data specific to this event includes actionText, actionClass, actionIndex, tappedClipActionText, tappedClipActionUrl, and tappedClipActionType.

Share Button Tapped#

Event Type: shareButtonTapped

This event is recorded when:

  • a user taps the share button on a clip

Share Success#

Event Type: shareSuccess

This event is recorded when:

  • a user selects and successfully shares a page from the system dialog

Whenever a Share Success event occurs, additional event data specific to this event includes shareMethod.

Paused Clip#

Event Type: pausedClip

This event is recorded when:

  • a user taps on the screen whilst a clip is playing to pause the clip - it does not fire when a clip is paused automatically by sharing or following an action

Note: For live clips this event will never be fired, as pausing/resuming live clips is not supported.

Resumed Clip#

Event Type: resumedClip

This event is recorded when:

  • a user taps a clip that is paused to resume playback - it does not fire when a clip is resumed automatically

Note: For live clips this event will never be fired, as pausing/resuming live clips is not supported.

Scrubbed Clip#

Event Type: scrubbedClip

This event is recorded when:

  • a user scrubs the clip to a different position by dragging the clip progress bar

Whenever a Scrubbed Clip event occurs, additional event data specific to this event includes openedReason, startPosition, endPosition, and scrubDirection.

Liked Clip#

Event Type: likedClip

This event is recorded when:

  • a user likes a clip by tapping the like button when they do not currently like the clip

Unliked Clip#

Event Type: unlikedClip

This event is recorded when:

  • a user unlikes a clip by tapping the like button when they currently like the clip

Finished Clip#

Event Type: finishedClip

This event is recorded when:

  • Dismissed Clip is fired
  • Next Clip is fired
  • Previous Clip is fired
  • Opened Category is fired
  • The clip reaches the end and starts a new loop
  • A user is viewing a Collection with "For You/Following" enabled and switches between "For You" and "Following"

Whenever a Finished Clip event occurs, additional event data specific to this event includes loopsViewed, durationViewed, and completionType.

Opened Category#

Event Type: openedCategory

This event is recorded when:

  • a user taps a category at the bottom of the Clips Player to open a new Category
  • a user opens a category by navigating back from another category

Note: This event is not fired when opening the top level of a collection - only when navigating to a specific category.

Dismissed Category#

Event Type: dismissedCategory

This event is recorded when:

  • a user navigates back using the back button to the previous category

This event does not fire when dismissing the top level collection.

Follow Category#

Event Type: followCategory

This event is recorded when:

  • a user taps the plus button under the follow category button of the Clips Player
  • a user taps the follow button at the top right of the Followable Category screen and the category was not followed

Unfollow Category#

Event Type: unfollowCategory

This event is recorded when:

  • a user taps the checkmark button under the follow category button of the Clips Player
  • a user taps the follow button at the top right of the Followable Category screen and the category was followed

Followable Category Tapped#

Event Type: followableCategoryTapped

This event is recorded when:

  • a user taps the follow category button of the Clips Player to open the Followable Category screen
  • a user swipes left from the right edge of the screen on a Clip with a Followable Category and opens the Followable Category screen

Enable Captions#

Event Type: enabledClipCaptions

This event is recorded when:

  • a user taps the button to enable Closed Captions in the Clips Player

Disable Captions#

Event Type: disabledClipCaptions

This event is recorded when:

  • a user taps the button to disable Closed Captions in the Clips Player

Followable Category Limit Shown#

Event Type: followableCategoryLimitShown

This event is recorded when:

  • the alert dialogue box associated with the Followable Category Limit is shown

Whenever a Followable Category Limit Shown event occurs, additional event data specific to this event includes followableCategoryLimitDialogue, followableCategoryLimitActionText, and followableCategoryLimitActionUrl.

Followable Category Limit Action Button Tapped#

Event Type: followableCategoryLimitActionButtonTapped

This event is recorded when:

  • a user taps on the customisable action button in the Followable Category Limit Dialogue Box

Whenever a Followable Category Limit Action Button Tapped event occurs, additional event data specific to this event includes followableCategoryLimitDialogue, followableCategoryLimitActionText, and followableCategoryLimitActionUrl.

Followable Category Limit Dismissed#

Event Type: followableCategoryLimitDismissed

This event is recorded when:

  • a user dismisses the Followable Category Limit Dialogue Box by tapping the cancel action button

Whenever a Followable Category Limit Dismissed event occurs, additional event data specific to this event includes followableCategoryLimitDialogue, followableCategoryLimitActionText, and followableCategoryLimitActionUrl.

Card Events#

The following properties may be included in Card-related events:

  • cardActionType
  • cardActionUrl
  • cardAspectRatio
  • cardBackgroundType
  • cardCollectionId
  • cardId
  • cardIndex
  • cardSubtitle
  • cardTitle
  • categories
  • categoryDetails
  • hasButton
  • isLive
  • actionLinkId

Card Viewed#

Event Type: cardViewed

This event is recorded when:

  • a Storyteller Card appears on screen, either by scrolling to it or opening a view where its visible

Card Tapped#

Event Type: cardTapped

This event is recorded when:

  • a user taps on the Storyteller Card view

Card Media and Audio#

Event Types: cardVideoStarted, cardVideoHeartbeat, cardVideoCompleted, cardAudioToggled

Video Cards emit playback-start, active-watch-time heartbeat, and completion events. durationViewed is milliseconds; videoStartReason identifies the start reason when available. Audio state changes supply audioToggleFrom, audioToggleTo, and isMuted. Image Cards do not emit video playback events. These events are also available in Flutter 11.6.5.

Ad Events#

The following properties may be included in Ad-related events:

  • actionText
  • actionType
  • actionUrl
  • adFormat
  • adId
  • adIndex
  • adPlacement
  • adRequestId
  • adResponseIdentifier
  • adSlotType
  • adUnitId
  • adStrategy
  • adType
  • advertiserName
  • airplayEnabled
  • categories
  • categoryDetails
  • contentLength
  • currentCategory
  • hasAction
  • paid ad fields such as adValueMicros, adCurrencyCode, and mediation source metadata when provided by the native SDK

For Story Ad events specifically, additional common fields include:

  • pageActionText
  • pageActionType
  • pageActionUrl
  • pageHasAction
  • pageType
  • storyPlaybackMode

For Clip Ad events specifically, additional common fields include:

  • clipFeedType
  • clipIndex
  • collection
  • collectionClipCount
  • loopsViewed

Opened Ad#

Event Type: openedAd

Stories#

This event is recorded when:

  • an ad is loaded because the previous story finished
  • a user swipes left on a story to go to the next story and an ad appears
  • a user swipes right on a story to go to the previous story and an ad appears

Whenever an Opened Ad event occurs, additional event data specific to this event includes openedReason.

Clips#

This event is recorded when:

  • a user swipes up on a clip to go to the next clip and an ad should appear next
  • a user swipes down on a clip to go to the previous clip and an ad should appear next
  • an ad completes a loop and begins playing again from the start

Dismissed Ad#

Event Type: dismissedAd

Stories#

This event is recorded when a user:

  • taps close to dismiss the ad
  • swipes down to dismiss the ad
  • taps back on their device UI to dismiss the ad (Android only)
  • taps to skip the ad if the ad is the last page in the current set of stories
  • swipes left on the ad to skip it if the ad is the last page in the current set of stories
  • completes the ad if the ad is the last page in the current set of stories

Whenever a Dismissed Ad event occurs, additional event data specific to this event includes durationViewed, dismissedReason and pagesViewedCount.

Clips#

This event is recorded when a user:

  • taps the back button to exit the clips player when an ad is being shown

Whenever a Dismissed Ad event occurs, additional event data specific to this event includes durationViewed, and clipsViewed.

Skipped Ad#

Event Type: skippedAd

Stories#

This event is recorded when a user:

  • swipes left to go to the next story before completing the current ad
  • taps to go to the next page on an ad before completing the current ad

Clips#

This event is recorded when:

  • a user swipes up to go to the next clip
  • a user swipes down to go the previous clip

Ad Action Button Tapped#

Event Type: adActionButtonTapped

Stories#

This event is recorded when a user:

  • swipes up on an ad to open a link
  • taps on the swipe up element of an ad to open a link

Clips#

This event is recorded when a user:

  • taps the action button at the bottom of an ad displayed in clips
  • swipes left on a clip to open the relevant action

Finished Ad#

Event Type: finishedAd

Stories#

This event is recorded at the same time as Dismissed Ad, Skipped Ad and Viewed Ad Page Complete and gives an easier way to determine when an ad finishes for any reason.

Clips#

This event is recorded at the same time as DismissedAd, or SkippedAd.

Paused Ad#

Event Type: pausedAdPage

Stories#

This event is recorded when a user pauses a page within an ad by pressing and holding on the page.

Clips#

This event is recorded when a user pauses a clip which is an ad by tapping the screen. It does not fire when a clip is paused automatically for sharing or following an action.

Resumed Ad#

Event Type: resumedAdPage

Stories#

This event is recorded when a user resumes playing a page within an ad by releasing their long press which paused the ad.

Clips#

This event is fired when a clip which is an ad is paused and a user taps the screen to resume playback. It does not fire when a clip is resumed automatically.

Viewed Ad Page First Quartile#

Event Type: viewedAdPageFirstQuartile

This event is recorded when a user reaches 1/4 of the way through the duration of a page or clip which is an ad.

For clip ads (which loop), it fires for each loop of the clip.

Viewed Ad Page Midpoint#

Event Type: viewedAdPageMidpoint

This event is recorded when a user reaches halfway through the duration of a page or clip which is an ad.

For clip ads (which loop), it fires for each loop of the clip.

Viewed Ad Page Third Quartile#

Event Type: viewedAdPageThirdQuartile

This event is recorded when a user reaches 3/4 of the way through the duration of a page or clip which is an ad.

For clip ads (which loop), it fires for each loop of the clip.

Viewed Ad Page Complete#

Event Type: viewedAdPageComplete

This event is recorded when a user reaches the end of the duration for a page or clip which is an ad.

For clip ads (which loop), it fires for each loop of the clip.

Ad Request Lifecycle and Revenue#

Event Types: adOpportunity, adRequested, adLoaded, adFailedToLoad, adPaid

These native events describe an eligible ad opportunity, request, successful load, load failure, or paid impression. They depend on the configured ad integration and provider; an opportunity does not guarantee a request, fill, or revenue. Correlate delivered playerSessionId, adRequestId, adSlotType, adUnitId, source/error fields, and paid value/currency fields when present.

Ad Session Summary#

Event Type: adSessionSummary

This event summarises the ad session after the native SDK has completed its session-level accounting. When present, the payload can include counts for opportunities, requests, loads, failed loads, paid events, and total revenue micros.

Organic Watch-time Events#

Event Types: storyHeartbeat, storyPageQuartile, clipVideoHeartbeat, clipVideoQuartile

Flutter 12.1.2 delivers these events with Android 12.2.0 and iOS 11.9.0. They are absent from Flutter 11.6.5. Story heartbeats describe the current non-ad Page; Clip heartbeats describe the current Clip. Heartbeats report accumulated active watch time in milliseconds through durationViewed, at five-second milestones. Paused or inactive playback does not advance active watch time.

Quartile events report playback progress milestones of 25, 50, and 75 through event.data.quartile. Quartiles measure content progress and can be crossed by scrubbing, so they are different from elapsed watch time. Use completedPage/completedLoop for completion and the ad quartile events for ads.

Storyteller.onUserActivityOccurred.listen((event) {
  if (event.type == 'storyHeartbeat' || event.type == 'clipVideoHeartbeat') {
    print('Active watch time: ${event.data.durationViewed} ms');
  } else if (event.type == 'storyPageQuartile' ||
      event.type == 'clipVideoQuartile') {
    final quartile = event.data.quartile;
    print('Playback progress: $quartile%');
  }
});

Playback Events#

The following properties may be included in Playback-related events:

  • pageActionText
  • pageActionUrl
  • pageHasAction
  • pageId
  • pageIndex
  • pageTitle
  • pageType
  • storyDisplayTitle
  • storyId
  • storyIndex
  • storyPlaybackMode
  • storyTitle
  • videoStartReason

Ready to Play#

Event Type: readyToPlay

This event is called once per video page at the point when the video player has been loaded.

Media Started#

Event Type: mediaStarted

This event is called once per video page at the point when the video starts to play for the first time.

Buffering Started#

Event Type: bufferingStarted

This event is called on video pages whenever the video starts to buffer.

Whenever a Buffering Started event occurs, additional event data specific to this event includes isInitialBuffering.

Buffering Ended#

Event Type: bufferingEnded

This event is called on video pages whenever the video finishes buffering.

Note: There should be at most one Ready to Play event and one Media Started event for every page. There may be multiple Buffering Started/Buffering Ended pairs of events for an individual page. There may not always be a Buffering Ended event for every Buffering Started event as the user may choose to exit the page during buffering.

Whenever a Buffering Ended event occurs, additional event data specific to this event includes isInitialBuffering and timeSinceBufferingBegan.

Audio and Story Captions#

Event Types: mutedStory, unmutedStory, mutedClip, unmutedClip, mutedAd, unmutedAd, enabledStoryCaptions, disabledStoryCaptions

These events represent native mute or Story-caption state changes. Clip caption changes use enabledClipCaptions and disabledClipCaptions above. Use nullable isMuted/captionsEnabled for state when supplied.

Current Video Player Changed#

Event Type: onCurrentVideoPlayerChanged

The native player reports a change of its current video-player instance. This technical callback is distinct from opening or completing content.

Sheet Events#

The following properties may be included in Sheet-related events:

  • actionText
  • captionsEnabled
  • categories
  • categoryDetails
  • clipActionText
  • clipActionType
  • clipActionUrl
  • clipFeedType
  • clipHasAction
  • clipId
  • clipIndex
  • clipTitle
  • collection
  • collectionClipCount
  • containerTitle
  • currentCategory
  • isLive
  • pageActionText
  • pageActionType
  • pageActionUrl
  • pageHasAction
  • pageId
  • pageIndex
  • pageTitle
  • pageType
  • searchFilter
  • searchSort
  • searchTerm
  • sheetId
  • sheetSize
  • sheetTitle
  • storyId
  • storyIndex
  • storyPageCount
  • storyTitle

Opened Sheet#

Event Type: openedSheet

This event is recorded when a user opens a Sheet.

Whenever an Opened Sheet event occurs, additional event data specific to this event includes openedReason.

Dismissed Sheet#

Event Type: dismissedSheet

This event is recorded when a user closes a Sheet.

Search Events#

The following properties may be included in Search-related events:

  • categories
  • categoryDetails
  • currentCategory
  • isSuggestion
  • searchFilter
  • searchFrom
  • searchSort
  • searchTerm

When search is opened from a Story context, additional properties include:

  • pageActionText
  • pageActionUrl
  • pageHasAction
  • pageId
  • pageIndex
  • pageTitle
  • pageType
  • storyDisplayTitle
  • storyId
  • storyIndex
  • storyPageCount
  • storyPlaybackMode
  • storyReadStatus
  • storyTitle

When search is opened from a Clip context, additional properties include:

  • clipActionText
  • clipActionUrl
  • clipHasAction
  • clipId
  • clipIndex
  • clipTitle
  • collection

Event Type: openedSearch

The openedSearch event is recorded when:

  • A user taps on Search from a Story within the Story player
  • A user taps on Search from a Clip within the Clip player
  • The Storyteller.openSearch() function is called

Event Type: dismissedSearch

The dismissedSearch event is recorded when a user taps the 'X' button to exit the Search interface.

Whenever an Dismissed Search event occurs, additional event data specific to this event includes dismissedReason.

Event Type: performedSearch

The performedSearch event is recorded when:

  • A user taps the 'Search' icon after entering a term in the Search bar (whether manually or by tapping the 'arrow' icon beside a Search suggestion to populate the search bar)
  • A user taps the 'Search' icon beside a Search suggestion. The Search is then performed with the suggestion as the term.
  • A user taps 'Apply filters' from the filters interface.

Opened Filters#

Event Type: openedFilters

The openedFilters event is recorded when, after a user has performed as Search, they press the 'Filter' icon to bring up the filter interface.

Note: That filters can only be applied after the initial search has been performed.

Dismissed Filters#

Event Type: dismissedFilters

This event is recorded when a user, after calling up the 'Filters' interface, swipes down to exit the interface without applying any.

Used Suggestion#

Event Type: usedSuggestion

The usedSuggestion event is recorded when:

  • A user taps the 'arrow' icon beside a Search suggestion to populate the Search bar. This does not trigger any other event, and the user may amend the Search bar input before performing a Search.
  • A user taps the 'Search' icon beside a Search suggestion. This simultaneously triggers a PerformedSearch event, above.

Whenever a Used Suggestion event occurs, additional event data specific to this event includes initialInput.

External Search Result Tapped#

Event Type: searchResultTapped

A tap on a tenant-configured external Search result can supply actionType, searchResultId, searchResultTitle, and searchResultSource, available as typed StorytellerUserActivityData properties from Flutter 12.1.2. External result visibility uses tileVisible when applicable.

Event Data#

Event data is exposed as StorytellerUserActivityData. Its typed properties are nullable and depend on the event, content, platform, and tracking options. A list of fields on this page is not a guarantee that each one is populated. Numeric values are converted to the declared Dart int or double; string lists and the typed metadata/context maps convert entries to strings. fields preserves the original delivered values instead of those conversions.

Additional and Legacy Properties#

categoryType, location, locale, and itemTitle are nullable strings whose presence depends on the native event. playerSessionId (String?) can correlate player/ad activity. videoStartReason (String?) can be natural or loop for video Cards.

The Dart type also retains legacy collectionId, collectionTitle, searchQuery, url, externalId, duration, position, error, errorMessage, and customData properties. A retained getter does not guarantee that the current native bridge supplies that key. In particular, externalId is used by native Storyteller ingestion and is not forwarded as a customer analytics field by the current Android mapper.

Raw Fields#

The fields (Map<String, dynamic>) property contains every string-keyed payload value delivered to Dart by the platform bridge, including values which do not have a typed Dart property. Preserve this map when forwarding events if your integration must remain forward compatible. On Android, a newly added native field must first be added to the Flutter plugin's explicit mapper.

Tile and List Position#

The tileIndex (int?) property is the one-based position for a tileVisible event. originalPosition and displayPosition (int?) are Android-only positions supplied for reordered lists when available.

Analytics Context#

The context (Map<String, String>?) property contains integrator context provided to a supported list, Card collection, or open call. Android delivers nonempty context to customer callbacks but removes it from Storyteller API ingestion; iOS includes it in callback payloads and encoded activity records. Do not assume identical downstream persistence across platforms. An omitted or empty Android context is absent from the bridge payload.

SDK Initialization Fields#

These typed fields describe internal sdkInitialized telemetry, which is excluded from customer callbacks on Android and iOS. Their presence on the Dart type does not make them initialization notifications. They include screenResolution, appId, appName, deviceModel, appVersion, operatingSystem, osVersion, deviceType, deviceBrand, minOsVersion, initializationSucceeded, enablePersonalization, enableStorytellerTracking, enableUserActivityTracking, enableAdTracking, enableFullVideoAnalytics, and enableRemoteViewingStore. Android may also provide targetOsVersion and languageVersion.

Story ID#

The storyId (String?) is the ID of the story for which the event occurred.

Story Title#

The storyTitle (String?) is the title of the story for which the event occurred.

Story Display Title#

The storyDisplayTitle (String?) is the display title of the Story for which the event occurred.

Story Index#

The storyIndex (int?) is the position of the story in its source list when provided. It can accompany Story events beyond openedStory.

Note: This value is 1-based.

Story Page Count#

The storyPageCount (int?) is the number of pages in the story.

Story Read Status#

The storyReadStatus (String?) describes the native read state when provided, including on openedStory and some other Story events.

Note: This will either be read or unread.

Page ID#

The pageId (String?) is the ID of the page for which the event occurred.

Page Index#

The pageIndex (int?) is the index of the page in the story for which the event occurred.

Note: This value is 1-based.

Page Type#

The pageType (String?) is the type of the page associated with the event. Native values include image, video, poll, triviaQuiz, and empty when applicable.

Story Playback Mode#

The storyPlaybackMode (String?) value states if the story was opened during the list or in the single story mode (Storyteller static method.) When supplied, the values are list or singleStory.

Page Has Action#

The pageHasAction (bool?) value states whether the page associated with the event contains an action.

Page Action Type#

The pageActionType (String?) is the type of the action on the page.

Page Action Text#

The pageActionText (String?) is the text call to action if the page has an action.

Page Action URL#

The pageActionUrl (String?) is the URL for the link if the page has an action.

The actionLinkId (String?) is the unique identifier of the action associated with the current story page, clip or card. This is not included for Ad events.

Opened Reason#

The openedReason (String?) value states how the user opened a Story or Clip. The possible values for this are: - storyListTap: The user tapped the Story in the Story row. - clipListTap: The user tapped the Clip in a Clip list. - deepLink: Content was opened with deep-link attribution. The Dart API option is StorytellerOpenReason.deeplink (channel value deeplink), while the emitted analytics value is deepLink. - swipe: The user swiped left or right to change the current Story. - automaticPlayback: The user completed the previous Page. - card: The user taps on a Card. - clipActionButton: The user clicked on an action button in the Clips player. - pageActionButton: The user clicked on the action button in the Story player. - tap: The user tapped on the next or previous Story Page to navigate to this page. - instanceMethod: Storyteller.openStory() or Storyteller.openPage() was called to open a Story or a Page. - loop: The user completes a loop of a Clip naturally or by scrubbing to the end of the Clip's duration. - categoryListTap / categoryBackTap: Navigation into or back from a category. - searchTap: Content opened from Search. - embeddedClipsOpen: Initial Embedded Clips opening. - pullToRefresh / reloadMethod: Content opened after a refresh or reload.

openedReason can be included on openedStory, openedClip, openedPage, storyInstructionsScreenViewed, completedLoop, openedAd and openedSheet events, and on other events when provided by the native SDK. Android uses storyInstructionScreenViewed for the instruction screen event.

Dismissed Reason#

The dismissedReason (String?) value states the way the user dismissed a story or clip. The possible values for this are closeButtonTapped (the user tapped close to dismiss the story); swipedDown (the user swiped down to dismiss the story); swipedFirstStory (the user swiped the first story to dismiss it); swipedFinalStory (the user swiped the final story to dismiss it); skippedFinalPage (the user tapped to skip the final page of the final story); completedFinalPage (the user completed the final page of the final story) and backButtonTapped (the user tapped the back button to dismiss the clip).

The reason can also accompany ad dismissal. Native versions can provide additional values, including backTapped, pageActionButton, and deepLinkReplacement; retain the string instead of rejecting unknown values.

Duration Viewed#

The durationViewed (double?) is the duration the user viewed the story or clip for in milliseconds. This is measured from the most recent openedStory or openedClip event with an Opened Reason of storyListTap, deepLink, card, pageActionButton, clipActionButton or clipListTap.

This timer is reset after any dismissedStory or dismissedClip events.

For finishedClip, this describes the active Clip viewing session in milliseconds. Heartbeat events use accumulated active watch time instead of the Story/player session timer described above.

Pages Viewed Count#

The pagesViewedCount (int?) is the total number of pages a user has viewed since the most recent openedStory event with an Opened Reason of storyListTap, pageActionButton, clipActionButton, card or deepLink. This count is reset after any dismissedStory events.

Quartile and External Search Keys#

The quartile (int?) is the playback progress milestone (25, 50, or 75) on organic quartile events. actionType, searchResultId, searchResultTitle, and searchResultSource (String?) identify a configured external Search result. These properties are new in Flutter 12.1.2.

Content Length#

The contentLength (int?) is the total duration of the page content in seconds.

Share Method#

The shareMethod (String?) is the component name of the app which the user has selected for sharing.

Advertisers Name#

The advertiserName (String?) is the name of the advertiser for a particular ad. This is only included for ad events.

Ad ID#

The adId (String?) is the ad ID if an event is associated with an ad.

Ad Type#

The adType (String?) is the type of component on which the ad is displayed. This can have values stories or clips.

Ad Format#

The adFormat (String?) represents the format of the Ad that was displayed. Possible values can be customNative, native, banner.

Ad Placement#

The adPlacement (String?) represents the placement of the ad. It can be either Between Stories, Between Pages or Between Clips. This is only included for ad events.

Ad Strategy#

The adStrategy (String?) represents the strategy used to display the ads. It can have the following values: Between Stories, Between Pages, Between Stories and Pages, Between Clips.

Ad Response Identifier#

The adResponseIdentifier (String?) represents the response identifier attached to the ad that was received from the ad provider. Used for debugging ad targeting.

Ad Index#

The adIndex (int?) represents the order of the Ad within the displayed Ads in a Story or Clip collection (1 for the first Ad, 2 for the second, etc.). This field is included in all ad-related events.

Ad Request ID#

The adRequestId (String?) identifies a native ad request when the SDK provides one.

Ad Slot Type#

The adSlotType (String?) describes the native ad slot, such as an interstitial or bottom banner placement, when available.

Ad Unit ID#

The adUnitId (String?) is the Google Ad Manager ad unit used for the request when available.

Paid ad and mediation callbacks can include adSource, adSourceName, adSourceId, adSourceInstanceName, adSourceInstanceId, adMediationGroupName, adMediationAbTestName, adMediationAbTestVariant, adAdapterLatencyMillis, adErrorCode, adErrorDomain, adErrorMessage, adValueMicros, adCurrencyCode, and adValuePrecision.

Ad Request Lifecycle and Revenue#

Event Types: adOpportunity, adRequested, adLoaded, adFailedToLoad, adPaid

These native events describe an eligible ad opportunity, request, successful load, load failure, or paid impression. They depend on the configured ad integration and provider; an opportunity does not guarantee a request, fill, or revenue. Correlate delivered playerSessionId, adRequestId, adSlotType, adUnitId, source/error fields, and paid value/currency fields when present.

Ad Session Summary Fields#

The adSessionSummary event can include adSessionOpportunitiesCount, adSessionRequestsCount, adSessionLoadsCount, adSessionFailedToLoadCount, adSessionPaidCount, adSessionRevenueMicros, and adSessionCurrencyCode.

Audio Toggle Fields#

The audioToggleFrom and audioToggleTo (String?) fields describe the previous and next audio states when an event represents an audio state change.

Mute and Analytics Flags#

The isMuted (bool?) and excludeFromAnalytics (bool?) fields expose native mute and analytics exclusion state when provided by the SDK.

Is Initial Buffering#

The isInitialBuffering (bool?) value is returned if the buffering happens at the start of playback for that page. This is only included for bufferingStarted and bufferingEnded events.

Time Since Buffering Began#

The timeSinceBufferingBegan (double?) value is the duration the current buffering lasted for in milliseconds. This is only included for bufferingEnded events.

Categories#

The categories (List<String>?) value contains the category names supplied by the native SDK for an event. It can be included on Story, Clip, Card, Ad and Search events when their native payload provides it.

Availability depends on the event, platform, bundled native SDK version and content context. Flutter forwards the native list without restricting it to openedStory. Handle null when the field is absent and an empty list when no category names are supplied; do not assume every event listed in this guide includes it.

Poll Answer#

The pollAnswerId (String?) is the ID of the answer the user selected when voting. This is only included on votedPoll events.

Trivia Quiz ID#

The triviaQuizId (String?) is the ID of the trivia quiz that was completed or answered. This is only included on triviaQuizQuestionAnswered and triviaQuizCompleted events.

Trivia Quiz Title#

The triviaQuizTitle (String?) is the title of the trivia quiz that was completed or answered. This is only included on triviaQuizQuestionAnswered and triviaQuizCompleted events.

Trivia Quiz Score#

The triviaQuizScore (int?) value is the score of the trivia quiz that was completed. This is only included on triviaQuizCompleted events.

Trivia Quiz Question ID#

The triviaQuizQuestionId (String?) is the ID of the trivia quiz question which was answered. This is only included on triviaQuizQuestionAnswered events.

Trivia Quiz Answer ID#

The triviaQuizAnswerId (String?) is the ID of the selected trivia quiz answer. This is only included on triviaQuizQuestionAnswered events.

Clip ID#

The clipId (String?) is the ID of the clip for which the event occurred.

Clip Title#

The clipTitle (String?) is the title of the clip for which the event occurred.

Clip Index#

The clipIndex (int?) is the index of the clip in the row or grid at the point it was selected or the index of the clip in the player inside the original row or grid. For Ad events, clip index refers to the index of the clip before the Ad.

Clip Collection Count#

The collectionClipCount (int?) is the total number of clips in the collection being viewed.

Clip Feed Type#

The clipFeedType (String?) indicates the type of clip feed being viewed. Possible values are default, forYou, and following.

Clips Viewed#

The clipsViewed (int?) value is the total number of clips a user has viewed since the most recent openedClip event with an Opened Reason of clipListTap, pageActionButton, card, clipActionButton or deepLink. This count should be reset after any dismissedClip events.

Loops Viewed#

The loopsViewed (int?) is for dismissedClip, the total number of loops (plays of an individual clip) a user has viewed since the most recent openedClip event with an Opened Reason of clipListTap, pageActionButton, card, clipActionButton or deepLink.

This count should be reset after any dismissedClip events. For finishedClip, the total number of loops.

Is Live#

The isLive (bool?) indicates whether a Clip, Story, or Card is currently being broadcast in real-time and is therefore "Live".

Airplay Enabled#

The airplayEnabled (bool?) indicates whether the device is currently using AirPlay for audio/video output when the event occurred.

Clip Has Action#

The clipHasAction (bool?) value is whether the clip associated with the event contains a primary action.

Clip Action Text#

The clipActionText (String?) is the text call to action if the clip associated with the event has a primary action link.

Clip Action URL#

The clipActionUrl (String?) is the URL linked to from the primary action if a clip associated with the event has a primary action.

Clip Action Type#

The clipActionType (String?) is the type of the primary action on a clip associated with the event. If there is no action button then the value is null.

Collection#

The collection (String?) is the ID of the collection if a story or clip is being played from a collection.

Collection Title#

collectionTitle (String?) is a retained legacy Dart property. Do not rely on it being populated: the current Android mapper does not supply this key. Use the nullable containerTitle for the native container title when delivered. Android supplies collectionId as an alias of collection; iOS does not guarantee that alias, so use collection for the collection ID.

Container Title#

The containerTitle (String?) is the title of the collection if a story or clip is being played from a collection.

Category Details#

The categoryDetails (List<StorytellerCategoryDetail>?) is a list of Category Detail objects. The details are the name, ID, type and placement of the category.

Category Name#

The categoryName (String?) of the category being navigated to or dismissed.

Category ID#

The categoryId (String?) of the category being navigated to or dismissed.

Current Category#

The currentCategory (StorytellerCategoryDetail?) is the category associated with the current placement when supplied. It exposes name, id, type, and nullable placement.

It can be supplied on Story and ad events; check for null before reading it.

Captions Enabled#

The captionsEnabled (bool?) property indicates whether captions are currently enabled for the Clips Player. This can be included in Clip analytics events and represents the state of captions at the time the event occurred.

Start Position#

The startPosition (int?) represents the playback position, in milliseconds, when the user started scrubbing the clip. This is only included for scrubbedClip events.

End Position#

The endPosition (int?) represents the playback position, in milliseconds, when the user stopped scrubbing the clip. This is only included for scrubbedClip events.

Eyebrow#

The eyebrow (String?) is a text field displayed on stories and clips, typically shown above the main title as a subtitle or descriptor.

Scrub Direction#

The scrubDirection (String?) indicates whether the user scrubbed to a position forward or backward on a Clip. Possible values are forward and backward. This is only included for scrubbedClip events.

Completion Type#

The completionType (String?) indicates how a user finished watching a Clip. Possible values are natural and scrubbed. This is included for finishedClip and completedLoop events.

Sheet ID#

The sheetId (String?) - The ID of the Sheet for which the event occurred.

Sheet Size#

The sheetSize (int?) - The height of the Sheet for which the event occurred. Possible values are 50, 75, and 100 (representing % of screen height).

Sheet Title#

The sheetTitle (String?) - The title of the Sheet for which the event occurred.

Search From#

The searchFrom (String?) identifies the Search entry point. Native values include clipsPlayer, storiesPlayer, and instanceMethod.

Is Suggestion#

The isSuggestion (bool?) indicates whether the Search for which the event is recorded used a suggested Search.

Note: When filters are opened (event), the Is Suggestion value should reflect what was used for the initial search performed before opening filters.

Initial Input#

The initialInput (String?) this property tracks the input at the moment the suggestion was used.

Search Filter#

The searchFilter (String?) property includes the content type and date posted used by search filter.

Search Sort#

The searchSort (String?) field indicates method by which the relevant Story / Clip's search results were sorted.

Search Term#

The searchTerm (String?) by which the Clips / Stories were searched, either entered in the search bar by the user or selected / filled from search suggestions.

Action Text#

The actionText (String?) property is used for general action text and can apply to both page actions and clip actions depending on the placement context.

Action Class#

The actionClass (String?) identifies whether the action button that was tapped is a primary or secondary action. Possible values are primary and secondary. This is only included for actionButtonTapped events.

Action Index#

The actionIndex (int?) is the 1-based index of the secondary action that was tapped. This is only included for actionButtonTapped events when a secondary action is tapped.

Tapped Clip Action Text#

The tappedClipActionText (String?) is the text of the specific action button (primary or secondary) that was tapped. This is only included for actionButtonTapped events.

Tapped Clip Action URL#

The tappedClipActionUrl (String?) is the URL of the specific action button (primary or secondary) that was tapped. This is only included for actionButtonTapped events.

Tapped Clip Action Type#

The tappedClipActionType (String?) is the type of the specific action button (primary or secondary) that was tapped. This is only included for actionButtonTapped events.

Has Secondary Actions#

The clipHasSecondaryActions (bool?) indicates whether the clip has any secondary actions. This can be included in Clip analytics events.

Secondary Actions Text#

The clipSecondaryActionsText (List<String>?) is an array of all the text CTAs on secondary actions for the clip. This can be included in Clip analytics events when the clip has secondary actions.

Secondary Action URLs#

The clipSecondaryActionUrls (List<String>?) is an array of all the URLs on secondary actions for the clip. This can be included in Clip analytics events when the clip has secondary actions.

Secondary Action Types#

The clipSecondaryActionTypes (List<String>?) is an array of all the types of secondary actions for the clip. This can be included in Clip analytics events when the clip has secondary actions.

Card ID#

The cardId (String?) is the ID of the Card for which the event occurred. This is included for cardTapped event.

Card Action Type#

The cardActionType (String?) is the type of the action on the Card. This is included for cardTapped event.

Card Action URL#

The cardActionUrl (String?) is the URL for the link if the Card has an action. This is included for cardTapped event.

Card Aspect Ratio#

The cardAspectRatio (String?) is the aspect ratio of the Card. This is included for cardTapped event.

Card Background Type#

The cardBackgroundType (String?) is the type of background on the Card. This can have the value image or video. This is included for cardTapped event.

Card Collection ID#

The cardCollectionId (String?) is the ID of the collection the Card belongs to. This is included for cardTapped event.

Card Index#

The cardIndex (int?) is the index of the Card in the collection.

Note: This value is 1-based.

Card Subtitle#

The cardSubtitle (String?) is the subtitle text displayed on the Card. This is included for cardTapped event.

Card Title#

The cardTitle (String?) is the title text displayed on the Card. This is included for cardTapped event.

Has Button#

The hasButton (bool?) indicates whether the Card displayed a button. This is included for cardViewed and cardTapped events.

Followable Category Limit Dialogue#

The followableCategoryLimitDialogue (String?) is the text displayed in the Followable Category Limit dialogue box. This is included for followableCategoryLimitShown, followableCategoryLimitActionButtonTapped, and followableCategoryLimitDismissed events.

Followable Category Limit Action Text#

The followableCategoryLimitActionText (String?) is the text displayed on the customisable action button in the Followable Category Limit dialogue box. This is included for followableCategoryLimitShown, followableCategoryLimitActionButtonTapped, and followableCategoryLimitDismissed events.

Followable Category Limit Action URL#

The followableCategoryLimitActionUrl (String?) is the URL associated with the customisable action button in the Followable Category Limit dialogue box. This is included for followableCategoryLimitShown, followableCategoryLimitActionButtonTapped, and followableCategoryLimitDismissed events.

Metadata#

The metadata (Map<String, String>?) contains custom metadata associated with the content for which the event occurred. For Clip events, this contains the metadata from the associated clip. For Story events, this contains the metadata from the associated page. It may be absent when content has no metadata.

Here's a complete example showing how to implement comprehensive analytics tracking:

import 'package:storyteller_sdk/storyteller_sdk.dart';
import 'dart:async';

class StorytellerAnalytics {
  StreamSubscription<StorytellerUserActivityEvent>? _analyticsSubscription;

  void initialize() {
    if (_analyticsSubscription != null) return;
    _analyticsSubscription = Storyteller.onUserActivityOccurred.listen(
      (event) {
        // Log all events
        print('Storyteller Event: ${event.type}');

        // Handle specific event types
        switch (event.type) {
          case 'openedStory':
            _handleStoryOpened(event.data);
            break;
          case 'openedClip':
            _handleClipOpened(event.data);
            break;
          case 'completedPage':
            _handlePageCompleted(event.data);
            break;
          case 'likedClip':
            _handleClipLiked(event.data);
            break;
          // Add more cases as needed
        }

        // Forward to your analytics platform
        _forwardToAnalytics(event);
      },
      onError: (error) {
        print('Analytics error: $error');
      },
    );
  }

  void _handleStoryOpened(StorytellerUserActivityData data) {
    print('Story Opened: ${data.storyTitle}');
    print('Read Status: ${data.storyReadStatus}');
    print('Categories: ${data.categories}');
  }

  void _handleClipOpened(StorytellerUserActivityData data) {
    print('Clip Opened: ${data.clipTitle}');
    print('Collection: ${data.collection}');
    print('Is Live: ${data.isLive}');
  }

  void _handlePageCompleted(StorytellerUserActivityData data) {
    print('Page Completed: ${data.pageTitle}');
    print('Duration: ${data.contentLength}s');
  }

  void _handleClipLiked(StorytellerUserActivityData data) {
    print('Clip Liked: ${data.clipTitle}');
  }

  void _forwardToAnalytics(StorytellerUserActivityEvent event) {
    // Forward to Firebase, Segment, Mixpanel, etc.
    // analytics.track(event.type, {
    //   'storyId': event.data.storyId,
    //   'clipId': event.data.clipId,
    //   ...event.data.fields,
    //   // ... other relevant fields
    // });
  }

  Future<void> dispose() async {
    await _analyticsSubscription?.cancel();
    _analyticsSubscription = null;
  }
}

Usage:

import 'package:flutter/widgets.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();

  // Subscribe before initialization/content interactions.
  final analytics = StorytellerAnalytics();
  analytics.initialize();

  final result = await Storyteller.initialize('your-api-key');
  if (!result.success) {
    await analytics.dispose();
    throw StateError(result.message ?? 'Storyteller initialization failed');
  }

  runApp(MyApp());
}

Verifying Your Integration#

Open a known published Story/Clip and log the event type and raw payload. A successful interaction produces openedStory or openedClip; closing the player produces its dismissal event. Retain one listener per owning service and cancel it during disposal to avoid duplicate forwarding.

If no events arrive, check that initialization succeeded, the listener was attached before content interactions, and enableUserActivityTracking is true. If IDs or titles are null, inspect await Storyteller.eventTrackingOptions(). Passing StorytellerEventTrackingOptions() sets enableFullVideoAnalytics to false by default and native code filters content identifiers/titles. Omitting the options argument to initialize currently defaults this flag to true on both platform bridges. Set it explicitly according to your tracking policy; see Privacy and Tracking.

Customer callbacks, Storyteller ingestion, and ad-provider tracking are separate destinations. Receiving an event does not prove that it was ingested or that an ad filled. For more diagnostic steps, see Troubleshooting.