Story impressions provide powerful analytics capabilities to track how users interact with ephemeral content. This feature enables content creators and community managers to gain valuable insights into story performance, user engagement patterns, and content reach across their communities.

Track Views

Mark stories as seen and collect impression data

Analyze Reach

Monitor unique user engagement and content reach

Link Analytics

Track click-through rates for story hyperlinks
Impressions represent the total number of times a story has been viewed, while reach represents the number of unique users who have viewed the story. Story impression data is updated in near real-time for optimal performance.

Analytics Metrics

Impression tracking provides essential metrics for story performance analysis and user engagement insights.
MetricDescriptionUse Case
ImpressionsTotal number of times a story has been viewedTrack overall content visibility and exposure
ReachNumber of unique users who viewed the storyMeasure audience size and content distribution
Click-Through Rate (CTR)Percentage of users who clicked story linksAssess hyperlink effectiveness and engagement

Marking Stories as Seen

Track user interactions by marking stories as seen when they are viewed in story feeds or opened in story viewers.
Stories must be in SYNCED sync state to be marked as seen. Attempting to mark unsynced stories will result in an error.

Implementation

1

Detect View Event

Determine when a story should be considered “seen” (e.g., visible in story viewer, minimum view duration reached).
2

Verify Sync State

Ensure the story is in SYNCED state before marking as seen.
3

Mark as Seen

Call the analytics method to record the impression and update the isSeen state.
4

Access Metrics

Retrieve updated impression and reach counts from the story object.
fun queryStoryReachedUsers(
    userRepository: AmityUserRepository,
    storyId: String
) {
    //Query viewed users
    userRepository
        .getReachedUsers(viewedType = AmityViewedType.STORY, viewedId = storyId)
        .doOnNext { users: PagingData<AmityUser> ->
            // PagingData<AmityUser>
        }
        .doOnError {
            // Exception
        }
        .subscribe()
}
Monitor user engagement with story hyperlinks to measure content effectiveness and click-through rates.
Stories must be in SYNCED sync state to track link clicks. This ensures accurate analytics data collection.
// storyObject is a type of `AmityStory`.
storyObject.analytics.markLinkAsClicked()

Querying Story Reached Users

Retrieve detailed information about users who have viewed specific stories, enabling audience analysis and engagement insights.

Parameters

ParameterTypeRequiredDescription
viewedTypeEnumYesType of content viewed (use .STORY)
viewedIdStringYesUnique identifier of the story

User Reach Analytics

token = userRepository.getReachedUsers(viewedType: .story, viewedId: "story-id").observe { Collection, change, error in
    // Handle list of reach users here.
}

Best Practices

Accurate Tracking

Mark stories as seen based on meaningful view events, not just feed appearance

Sync State Validation

Always verify stories are synced before recording analytics events

User Privacy

Respect user privacy preferences when collecting impression data