---
agentTools:
  projectIndex: https://docs.storyly.io/llms.txt
---

# Analytics Mapping

# Storyly Placement SDK — Analytics System Raporu

**Total Events:** 70+  |  **Widget Types:** 5  |  **Callback:** 4  |  **Platform:** Android / iOS

***

## Analytics Architecture

1. **SDK Layer** — Detects user interactions, produces events, and delivers them to the callback. Fully provider-agnostic.
2. **Host App** — `onEvent` reads the event type via `payload.baseEvent.getType()`. Widget-specific extensions are used for typed payloads.
3. **Analytics Provider** — Events are forwarded to Firebase, Adjust, or any custom system. No SDK-side configuration required.

***

## Platform Comparison

|                         | Android (Kotlin)                                                         | iOS (Swift)                                    |
| ----------------------- | ------------------------------------------------------------------------ | ---------------------------------------------- |
| **Delegate / Listener** | `STRListener`                                                            | `STRDelegate`                                  |
| **Main Import**         | `import com.appsamurai.storyly.placement.ui.STRListener`                 | `import StorylyPlacement`                      |
| **Core Import**         | `import com.appsamurai.storyly.core.analytics.event.STREventPayload`     | `import StorylyCore`                           |
| **StoryBar Import**     | `import com.appsamurai.storyly.storybar.analytics.event.StoryBarEvent`   | `import StorylyStoryBar`                       |
| **Video Feed Import**   | `import com.appsamurai.storyly.videofeed.analytics.event.VideoFeedEvent` | `import StorylyVideoFeed`                      |
| **Banner Import**       | `import com.appsamurai.storyly.banner.analytics.event.BannerEvent`       | `import StorylyBanner`                         |
| **Callback Lambda**     | `payload.storyBar { it -> ... }`                                         | `payload.storyBar { payload in ... }`          |
| **Event Names**         | Identical (e.g. StoryViewed, BannerCTAClicked)                           | Identical (e.g. StoryViewed, BannerCTAClicked) |

***

## Callback Flow — Code Example

```kotlin
storylyView.listener = object : STRListener {
    override fun onEvent(widget: STRWidgetController, payload: STREventPayload) {
        val eventType = payload.baseEvent.getType()

        payload.storyBar { storyBarPayload ->
            analytics.track(eventType, storyBarPayload)
        }
        payload.videoFeed { videoFeedPayload ->
            analytics.track(eventType, videoFeedPayload)
        }
        payload.banner { bannerPayload ->
            analytics.track(eventType, bannerPayload)
        }
    }
}
```

<br />

```swift
storylyView.delegate = self

func onEvent(widget: STRWidgetController, payload: STREventPayload) {
    let eventType = payload.baseEvent.getType()

    payload.storyBar { storyBarPayload in
        analytics.track(eventType, storyBarPayload)
    }
    payload.videoFeed { videoFeedPayload in
        analytics.track(eventType, videoFeedPayload)
    }
    payload.banner { bannerPayload in
        analytics.track(eventType, bannerPayload)
    }
}
```

***

## Event Table — Android & iOS

*Note: the original document had filter buttons (All / Impression / Click‑CTA / Navigation / Interaction / Lifecycle) to narrow this table by category. In this Markdown version the full table is listed; use the **Category** column to filter manually.*

### StoryBar

| Event Name                         | Widget   | When Triggered                                                 | Category    |
| ---------------------------------- | -------- | -------------------------------------------------------------- | ----------- |
| `StorylyBarImpression`             | StoryBar | When the Story Bar is seen by the user with new groups         | Impression  |
| `StoryImpression`                  | StoryBar | When a story is marked as watched by the user                  | Impression  |
| `StoryViewed`                      | StoryBar | When a story is loaded                                         | Lifecycle   |
| `StoryShown`                       | StoryBar | When a story is displayed                                      | Lifecycle   |
| `StoryCompleted`                   | StoryBar | When a story is completed                                      | Lifecycle   |
| `StoryDismissed`                   | StoryBar | When a story is dismissed                                      | Lifecycle   |
| `StoryPaused`                      | StoryBar | When a story is paused                                         | Lifecycle   |
| `StoryResumed`                     | StoryBar | When a story is resumed                                        | Lifecycle   |
| `StoryGroupOpened`                 | StoryBar | When a group is opened by user, deep link, or programmatically | Navigation  |
| `StoryGroupUserOpened`             | StoryBar | When a group is opened by user tap                             | Navigation  |
| `StoryGroupDeepLinkOpened`         | StoryBar | When a group is opened via deep link                           | Navigation  |
| `StoryGroupProgrammaticallyOpened` | StoryBar | When a group is opened programmatically                        | Navigation  |
| `StoryGroupCompleted`              | StoryBar | When all stories in the group are completed                    | Lifecycle   |
| `StoryGroupClosed`                 | StoryBar | When the user closes a group                                   | Navigation  |
| `StoryGroupPreviousSwiped`         | StoryBar | When swiped to the previous group                              | Navigation  |
| `StoryGroupNextSwiped`             | StoryBar | When swiped to the next group                                  | Navigation  |
| `StoryPreviousClicked`             | StoryBar | When the previous story is tapped                              | Navigation  |
| `StoryNextClicked`                 | StoryBar | When the next story is tapped                                  | Navigation  |
| `StoryCTAClicked`                  | StoryBar | When a CTA button is tapped or swipe up is performed           | Click / CTA |
| `StoryButtonActionClicked`         | StoryBar | When a button is tapped                                        | Click / CTA |
| `StoryImageButtonActionClicked`    | StoryBar | When an image button is tapped                                 | Click / CTA |
| `StorySwipeActionClicked`          | StoryBar | When a swipe action is tapped                                  | Click / CTA |
| `StoryProductTagExpanded`          | StoryBar | When a product tag dot is tapped                               | Click / CTA |
| `StoryProductTagClicked`           | StoryBar | When an expanded product area is tapped                        | Click / CTA |
| `StoryProductCardClicked`          | StoryBar | When a product card is tapped                                  | Click / CTA |
| `StoryProductCatalogClicked`       | StoryBar | When a product catalog is tapped                               | Click / CTA |
| `StoryLiked`                       | StoryBar | When a story is liked                                          | Interaction |
| `StoryShared`                      | StoryBar | When a story share URL is generated                            | Interaction |
| `StoryPollAnswered`                | StoryBar | When a poll is answered                                        | Interaction |
| `StoryQuizAnswered`                | StoryBar | When a quiz is answered                                        | Interaction |
| `StoryImageQuizAnswered`           | StoryBar | When an image quiz is answered                                 | Interaction |
| `StoryEmojiClicked`                | StoryBar | When an emoji is selected from the list                        | Interaction |
| `StoryRated`                       | StoryBar | When a rating component is voted                               | Interaction |
| `StoryCountdownReminderAdded`      | StoryBar | When a countdown reminder is added                             | Interaction |
| `StoryCountdownReminderRemoved`    | StoryBar | When a countdown reminder is removed                           | Interaction |
| `StoryPromoCodeCopied`             | StoryBar | When a promo code is copied                                    | Interaction |
| `StoryCommentSent`                 | StoryBar | When a comment is submitted                                    | Interaction |
| `StoryCommentInputOpened`          | StoryBar | When the comment input is opened                               | Interaction |
| `StoryCommentInputClosed`          | StoryBar | When the comment input is closed                               | Interaction |
| `StorySeeked`                      | StoryBar | When the user seeks forward in a long story video              | Interaction |

### Video Feed

| Event Name                         | Widget     | When Triggered                                            | Category    |
| ---------------------------------- | ---------- | --------------------------------------------------------- | ----------- |
| `VideoFeedBarImpression`           | Video Feed | When Video Feed is seen by the user with new groups       | Impression  |
| `VideoFeedItemImpression`          | Video Feed | When an item is marked as watched by the user             | Impression  |
| `VideoFeedItemViewed`              | Video Feed | When an item is loaded                                    | Lifecycle   |
| `VideoFeedItemCompleted`           | Video Feed | When an item is completed                                 | Lifecycle   |
| `VideoFeedItemPaused`              | Video Feed | When an item is paused                                    | Lifecycle   |
| `VideoFeedItemResumed`             | Video Feed | When an item is resumed                                   | Lifecycle   |
| `VideoFeedGroupOpened`             | Video Feed | When a group is opened (user, deep link, or programmatic) | Navigation  |
| `VideoFeedGroupUserOpened`         | Video Feed | When a group is opened by user tap                        | Navigation  |
| `VideoFeedGroupDeepLinkOpened`     | Video Feed | When a group is opened via deep link                      | Navigation  |
| `VideoFeedGroupClosed`             | Video Feed | When a group is closed                                    | Navigation  |
| `VideoFeedGroupCompleted`          | Video Feed | When all items in the group are completed                 | Lifecycle   |
| `VideoFeedGroupPreviousSwiped`     | Video Feed | When swiped to the previous group                         | Navigation  |
| `VideoFeedGroupNextSwiped`         | Video Feed | When swiped to the next group                             | Navigation  |
| `VideoFeedItemPreviousClicked`     | Video Feed | When the previous item is tapped                          | Navigation  |
| `VideoFeedItemNextClicked`         | Video Feed | When the next item is tapped                              | Navigation  |
| `VideoFeedItemCTAClicked`          | Video Feed | When a CTA button is tapped                               | Click / CTA |
| `VideoFeedItemButtonActionClicked` | Video Feed | When a button is tapped                                   | Click / CTA |
| `VideoFeedItemSwipeActionClicked`  | Video Feed | When a swipe action is tapped                             | Click / CTA |
| `VideoFeedItemProductTagClicked`   | Video Feed | When a product tag is tapped                              | Click / CTA |
| `VideoFeedItemProductCardClicked`  | Video Feed | When a product card is tapped                             | Click / CTA |
| `VideoFeedItemLiked`               | Video Feed | When an item is liked                                     | Interaction |
| `VideoFeedItemShared`              | Video Feed | When a share URL is generated                             | Interaction |
| `VideoFeedItemPollAnswered`        | Video Feed | When a poll is answered                                   | Interaction |
| `VideoFeedItemQuizAnswered`        | Video Feed | When a quiz is answered                                   | Interaction |
| `VideoFeedItemPromoCodeCopied`     | Video Feed | When a promo code is copied                               | Interaction |
| `VideoFeedItemCommentSent`         | Video Feed | When a comment is submitted                               | Interaction |
| `VideoFeedItemSeeked`              | Video Feed | When the video is seeked forward                          | Interaction |

### Banner

| Event Name             | Widget | When Triggered                                   | Category    |
| ---------------------- | ------ | ------------------------------------------------ | ----------- |
| `BannerImpression`     | Banner | When the banner is marked as watched by the user | Impression  |
| `BannerViewed`         | Banner | When the banner is displayed on screen           | Lifecycle   |
| `BannerCompleted`      | Banner | When the banner is completed                     | Lifecycle   |
| `BannerPreviousSwiped` | Banner | When swiped to the previous banner               | Navigation  |
| `BannerNextSwiped`     | Banner | When swiped to the next banner                   | Navigation  |
| `BannerCTAClicked`     | Banner | When the CTA button is tapped                    | Click / CTA |

***

## Other Callbacks

| Callback                                | Description                                                                             | Usage                                                                     |
| --------------------------------------- | --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `onWidgetReady(widget, ratio)`          | Fired when widget loads with the aspect ratio. Widget stays at 0 height if not handled. | Compute `height = width / ratio` and call requestLayout() / update frame. |
| `onActionClicked(widget, url, payload)` | Fired when a CTA/link is tapped. Returns the URL defined in the dashboard.              | Route URL through deep link handler or open in browser.                   |
| `onFail(widget, payload)`               | Fired when the widget or an operation fails. Returns STRErrorPayload.                   | Log the error and show a fallback UI if needed.                           |

***

## SDK Events → Dashboard Metrics Mapping

This section maps SDK-level events to the metrics visible in the Storyly Dashboard. Use this as a reference when verifying that your analytics implementation aligns with dashboard data.

| Dashboard Metric       | Dashboard Label        | Corresponding SDK Events                                                                           | Description                                                                                                           |
| ---------------------- | ---------------------- | -------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| Impressions            | Impressions            | `StorylyBarImpression`, `VideoFeedBarImpression`, `BannerImpression`                               | Total number of times the widget was viewed with new content. Triggered once per session per new group set.           |
| Unique Impressions     | Unique Impressions     | `StorylyBarImpression` (deduplicated)                                                              | Unique users who saw the widget. Deduplication is handled server-side based on user identifier.                       |
| Story / Item Views     | Story Views            | `StoryViewed`, `VideoFeedItemViewed`, `BannerViewed`                                               | Total number of times individual content items were loaded and displayed.                                             |
| Completion Rate        | Completion Rate        | `StoryCompleted`, `VideoFeedItemCompleted`, `BannerCompleted`                                      | Number of stories/items watched to the end. Completion rate = completions / views.                                    |
| CTA Clicks             | CTA Clicks             | `StoryCTAClicked`, `VideoFeedItemCTAClicked`, `BannerCTAClicked`                                   | Number of CTA button taps or swipe-up actions. Click rate = CTA clicks / impressions.                                 |
| Interactions           | Interactions           | `StoryButtonActionClicked`, `StoryImageButtonActionClicked`, `StorySwipeActionClicked`             | Interactive element taps within content. Counted as engagement interactions on the dashboard.                         |
| Product Clicks         | Product Clicks         | `StoryProductTagClicked`, `StoryProductCardClicked`, `VideoFeedItemProductCardClicked`             | Taps on shoppable product elements. Feeds into the commerce analytics section of the dashboard.                       |
| Poll / Quiz Engagement | Interactive Engagement | `StoryPollAnswered`, `StoryQuizAnswered`, `VideoFeedItemPollAnswered`, `VideoFeedItemQuizAnswered` | Responses to interactive content components. Shown as engagement rate in the dashboard.                               |
| Likes                  | Likes                  | `StoryLiked`, `VideoFeedItemLiked`                                                                 | Number of like reactions on content.                                                                                  |
| Shares                 | Shares                 | `StoryShared`, `VideoFeedItemShared`                                                               | Number of share URL generations. Note: fires when the URL is created, not when the user actually completes the share. |
| Open Rate              | Opens / Open Rate      | `StoryGroupOpened`, `VideoFeedGroupOpened`                                                         | Number of times a story/video group was opened. Open rate = opens / impressions.                                      |
| Promo Code Actions     | Promo Code Actions     | `StoryPromoCodeCopied`, `VideoFeedItemPromoCodeCopied`                                             | Number of times a promo code was copied from the widget.                                                              |

***

## Key Notes

| Note                 | Detail                                                                                                                                                         |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Impression vs Viewed | Viewed fires immediately when content appears on screen. Impression fires after the user has watched for a qualifying duration — a stronger engagement signal. |
| Using getType()      | STREvent does not expose a `.type` property. Always use `baseEvent.getType()` to retrieve the event name as a string.                                          |
| Payload types        | `STREventPayload` is for `onEvent`, `STRErrorPayload` is for `onFail`, and `STRPayload` is for `onActionClicked`. Do not mix these.                            |
| Share event timing   | `StoryShared` / `VideoFeedItemShared` fires when the share URL is generated, not when the user completes the share action in the OS sheet.                     |