> For the complete documentation index, see [llms.txt](https://docs.amondo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.amondo.com/developer-guides/websdk-events.md).

# Web SDK Events

The Web SDK emits analytics events automatically when an Imprint is embedded on a page. Events are sent to Amondo analytics when analytics is enabled, and are also dispatched on `window` as `amondoEvent` for debugging or custom analytics pipelines.

```javascript
window.addEventListener('amondoEvent', (event) => {
  console.log(event.detail.event)
  console.log(event.detail)
})
```

Each dispatched event has an `event` field containing the event name. The remaining fields depend on the event type and the current Imprint, format, Tile and Frame context.

## Common Properties

These properties are registered for the Web SDK session and appear on most events.

| Property                 | Description                                                   |
| ------------------------ | ------------------------------------------------------------- |
| `sdk_version`            | Web SDK version.                                              |
| `imprint_id`             | Published Imprint identifier.                                 |
| `imprint_title`          | Imprint title.                                                |
| `imprint_mode`           | Imprint format, for example `GALLERY`, `CAROUSEL` or `STORY`. |
| `team_id`                | Team identifier for the Imprint.                              |
| `rendering_mode`         | `NORMAL` or `ADS`.                                            |
| `tiles_total`            | Total number of Tiles in the Imprint, when available.         |
| `imprint_tag_analytics`  | Optional Imprint analytics tag.                               |
| `amo_user_id`            | Optional user identifier passed through `analytics.userId`.   |
| `connection_type`        | Browser network effective connection type, when available.    |
| `browser_language`       | Browser language.                                             |
| `$device_type`           | Device type inferred by PostHog.                              |
| `prefers_dark_mode`      | Browser colour scheme preference.                             |
| `prefers_reduced_motion` | Browser reduced-motion preference.                            |

Custom values passed in `analytics.options` are added to the session and sent with Web SDK events.

`media_url` and `outcome_media_url` contain the media URL used by the SDK for the Tile or Reveal outcome. For Cloudinary-hosted media, the SDK uses `publicUrl` when it is available and falls back to `secureUrl`.

## Timing Properties

`imprint_time_ms` is added to captured events. It measures accumulated time while the Imprint is considered in view. The timer pauses when the Imprint leaves view or the page becomes hidden. `$pageleave` also receives `imprint_time_ms` before the event is sent.

The default Imprint viewed threshold is 0%. Integrations can set `analytics.imprintViewedThresholdPercent` to require a higher visible percentage before `imprint_viewed` fires.

`tile_time_ms` is only added to `tile_left`. It measures wall-clock time from the qualified `tile_viewed` event to leave or cleanup.

`time_spent_ms` appears on Frame events that measure active Frame dwell time.

## Page and Imprint Events

| Event               | Runs when                                                                                                            | Key properties                                                              |
| ------------------- | -------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| `$pageview`         | Web SDK analytics initialises. Emitted across supported rendering modes, including `ADS`.                            | Common properties, `imprint_time_ms`.                                       |
| `$pageleave`        | The browser page is left or hidden. Emitted once per SDK instance across supported rendering modes, including `ADS`. | Common properties, current page, slide or story context, `imprint_time_ms`. |
| `imprint_viewed`    | The Imprint reaches the configured viewed threshold.                                                                 | Common properties, `imprint_time_ms`.                                       |
| `imprint_qualified` | The Imprint stays sufficiently visible for 1 continuous second. Can fire again after leaving and re-entering view.   | Common properties, `imprint_time_ms`.                                       |
| `imprint_left`      | The Imprint leaves the viewport after being viewed.                                                                  | Common properties, `scrolled_percentage`, `imprint_time_ms`.                |
| `imprint_scrolled`  | A Gallery Imprint scroll percentage changes.                                                                         | Common properties, `scrolled_percentage`, `imprint_time_ms`.                |

## Format Events

| Event           | Format   | Runs when                                                 | Key properties                                                                                              |
| --------------- | -------- | --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| `page_changed`  | Gallery  | User changes Gallery page.                                | `page_id`, `page_index`, `opened_from_url`, `changed_from_frame`, `imprint_time_ms`.                        |
| `slide_viewed`  | Carousel | Carousel slide is viewed, including initial active slide. | `slide_id`, `slide_index`, `imprint_time_ms`.                                                               |
| `slide_changed` | Carousel | User navigates to another slide by arrow or swipe.        | `slide_id`, `slide_index`, `subsequent_slide_id`, `subsequent_slide_index`, `direction`, `imprint_time_ms`. |
| `story_viewed`  | Stories  | Story section appears in the viewport.                    | `story_id`, `story_title`, `story_index`, `story_state`, `imprint_time_ms`.                                 |
| `story_clicked` | Stories  | User clicks a story cover or highlight.                   | `story_id`, `story_title`, `story_index`, `story_state`, `imprint_time_ms`.                                 |
| `story_opened`  | Stories  | Story opens in Frame view.                                | `story_id`, `story_title`, `story_index`, `story_state`, `imprint_time_ms`.                                 |

## Tile and Frame Events

| Event                 | Runs when                                                                                      | Key properties                                                                                                                                                           |
| --------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `tile_viewed`         | A Tile is at least 50% visible after the scroll-stable delay. Default delay is 300ms.          | `tile_id`, `tile_type`, `tile_source`, `media_url`, `media_type`, `tile_tag_analytics`, `imprint_time_ms`.                                                               |
| `tile_left`           | A previously viewed Tile leaves view or unmounts.                                              | `tile_id`, `tile_type`, `tile_source`, `media_url`, `media_type`, `tile_tag_analytics`, `tile_time_ms`, `imprint_time_ms`.                                               |
| `tile_clicked`        | User clicks or taps a Tile.                                                                    | `tile_id`, `tile_type`, `tile_source`, `media_url`, `media_type`, `tile_tag_analytics`, `imprint_time_ms`.                                                               |
| `frame_viewed`        | Frame opens or Frame navigation lands on a new Tile.                                           | `tile_id`, `tile_type`, `tile_source`, `opened_from_url`, `media_url`, `media_type`, `tile_tag_analytics`, `imprint_time_ms`.                                            |
| `frame_changed`       | User or autoplay moves to another Tile in Frame view. Navigation is cooldown-limited to 200ms. | `tile_id`, `subsequent_tile_id`, `direction`, `changed_method`, `time_spent_ms`, `media_url`, `media_type`, `tile_tag_analytics`, `imprint_time_ms`.                     |
| `frame_closed`        | Frame closes or is dismissed.                                                                  | `tile_id`, `tile_type`, `tile_source`, `time_spent_ms`, `media_url`, `media_type`, `tile_tag_analytics`, `imprint_time_ms`.                                              |
| `frame_story_changed` | Frame navigation crosses from one story section to another.                                    | `prev_story_id`, `new_story_id`, `direction`, `story_state`, `imprint_time_ms`.                                                                                          |
| `source_clicked`      | User clicks a source or attribution link.                                                      | `tile_id`, `tile_type`, `tile_source`, `destination_url`, `tile_tag_analytics`, `imprint_time_ms`.                                                                       |
| `cta_clicked`         | User clicks a Clickthrough, Quiz, Poll or Reveal CTA.                                          | `tile_id`, `tile_type`, `tile_source`, `destination_url`, `cta_label`, `outcome_id`, `outcome_media_url`, `outcome_media_type`, `tile_tag_analytics`, `imprint_time_ms`. |

## Video Events

| Event                    | Runs when                                                                                   | Key properties                                                                       |
| ------------------------ | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| `video_played`           | A video crosses a tracked progress point. The `duration` value is `0`, `50`, `90` or `100`. | `tile_id`, `media_url`, `duration`, `loop`, `tile_tag_analytics`, `imprint_time_ms`. |
| `video_midpoint_reached` | First play of a video reaches 50%. This fires once for loop `0`.                            | `tile_id`, `media_url`, `tile_tag_analytics`, `imprint_time_ms`.                     |

## Activation Tile Events

| Event               | Tile type | Runs when                                                                    | Key properties                                                                                                                                                         |
| ------------------- | --------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `quiz_started`      | Quiz      | User starts a Quiz Tile.                                                     | `tile_id`, `tile_tag_analytics`, `imprint_time_ms`.                                                                                                                    |
| `question_answered` | Quiz      | User selects an answer.                                                      | `tile_id`, `question_index`, `answer_index`, `is_correct`, `tile_tag_analytics`, `imprint_time_ms`.                                                                    |
| `question_finished` | Quiz      | User advances from a non-final question.                                     | `tile_id`, `question_index`, `tile_tag_analytics`, `imprint_time_ms`.                                                                                                  |
| `quiz_finished`     | Quiz      | User completes all quiz questions.                                           | `tile_id`, `tile_tag_analytics`, `imprint_time_ms`.                                                                                                                    |
| `quiz_retried`      | Quiz      | User restarts a completed quiz.                                              | `tile_id`, `tile_tag_analytics`, `imprint_time_ms`.                                                                                                                    |
| `quiz_shared`       | Quiz      | User shares the quiz result.                                                 | `tile_id`, `tile_tag_analytics`, `imprint_time_ms`.                                                                                                                    |
| `poll_voted`        | Poll      | Vote submission succeeds and results are returned.                           | `tile_id`, `option_id`, `tile_tag_analytics`, `imprint_time_ms`.                                                                                                       |
| `poll_shared`       | Poll      | User shares poll results.                                                    | `tile_id`, `tile_tag_analytics`, `imprint_time_ms`.                                                                                                                    |
| `reveal_started`    | Reveal    | User first interacts with a Reveal Tile. Fires once per Tile instance.       | `tile_id`, `reveal_type`, `outcome_id`, `outcome_media_url`, `outcome_media_type`, `tile_tag_analytics`, `imprint_time_ms`.                                            |
| `tile_scratched`    | Reveal    | Scratch Reveal progress milestone is reached. Fires once for each milestone. | `tile_id`, `reveal_type`, `outcome_id`, `outcome_media_url`, `outcome_media_type`, `scratch_milestone`, `scratch_percentage`, `tile_tag_analytics`, `imprint_time_ms`. |
| `reveal_completed`  | Reveal    | Reveal outcome is shown.                                                     | `tile_id`, `reveal_type`, `outcome_id`, `outcome_media_url`, `outcome_media_type`, `time_to_reveal_ms`, `scratch_percentage`, `tile_tag_analytics`, `imprint_time_ms`. |

`tile_scratched` is emitted only for Scratch Reveal Tiles. The tracked milestones are `10_percent`, `50_percent` and `done`. Broken-cover auto-reveal does not emit `tile_scratched`.

Form Tiles render in Web SDK embedded Imprints, including Yes/No and multiple-choice inputs, but they do not currently emit canonical form-specific events for field changes, Yes/No selections, multiple-choice selections or completed form submissions.

## Events Not Currently Emitted

The Web SDK does not currently emit canonical events for `form_start`, `form_complete`, `ugc_upload`, `competition_entry` or generic `share`. Share behaviour is currently represented by `quiz_shared` and `poll_shared`.

Do not add `tile_dwell_3s` or `tile_dwell_10s` as separate events. Derive dwell thresholds from `tile_left.tile_time_ms`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.amondo.com/developer-guides/websdk-events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
