Skip to content

Commit

Permalink
Update docs for media player 0.7.0 release (#709)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgewoodhead authored Dec 7, 2023
1 parent 1363123 commit 51c6626
Show file tree
Hide file tree
Showing 6 changed files with 539 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const printYamlVariables = (data) => {

export const MyMdxComponent = () => {
const schemaName = 'dbtMediaPlayer';
const versions = ['0.6.1'];
const versions = ['0.7.0', '0.6.1'];
const label = 'dbt media player version';
const output = printYamlVariables;
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,31 @@ The package contains multiple staging models however the mart models are as foll
- It also produces a `_pivot_base` table to calculate the percent_progress boundaries and weights that are used to calculate the total play_time and other related media fields.
- **Media plays:** Removes impressions from the media base table while keeping the same structure as the `snowplow_media_player_base` table. Removing impressions means that only media sessions (identified by the `play_id` key) in which the user played the content are kept.
- The media plays module outputs the `snowplow_media_player_plays_by_pageview` view.
- **Media stats:** Aggregates the media base table to individual `media_id` level, calculating the main KPIs and overall video/audio metrics.
- **Media stats:** Aggregates the media base table to individual `media_identifier` level, calculating the main KPIs and overall video/audio metrics.
- It uses the native dbt incremental materialization on a pageview basis after a set time window passed. This is to prevent complex and expensive queries due to metrics which need to take the whole page_view events into calculation. This way the metrics will only be calculated once per pageview / media, after no new events are expected.
- The media stats module outputs the `snowplow_media_player_media_stats` table.
- **Media ad views:** Summarizes metadata and KPIs for each ad view within a media playback. Each ad a user viewed will result in a single row with information about the progress reached, whether the ad was skipped or clicked.
- The media ad views module outputs the `snowplow_media_player_media_ad_views` table.
- **Media ads:** Aggregates all ad views to produce a summary of the KPIs for each ad played within each media content. Produces total counts of views, skips, clicks and progress reached. It also counts the metrics in terms of unique users (e.g., number of users who clicked the ad).
- It outputs the `snowplow_media_player_media_ads` table.

## Identifiers

The package generates robust identifiers for use in the incremental logic and keys for the derived tables.

| Identifier | Definition |
| ----------------------- | ----------------------------- |
| `session_identifier` | The session identifier as defined in your dbt project variables which is is used for the package's [incremental sessionization logic](/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-advanced-usage/dbt-incremental-logic/). If not set, this defaults to the `mediaSessionId` from the media session entity if enabled, else to the page/screen view id. This ensures all media events for a play spanning multiple `domain_sessionid`s are modelled. The more traditional session identifier `domain_sessionid` can be extracted from the `domain_sessionid_array` field. |
| `user_identifier` | The user identifier as defined in your dbt project variables. If not set, this defaults to be `domain_userid` for web or the `userId` from the client session entity for mobile. |
| `media_identifier` | Used to identify individual media elements/content. It is generated from the `player_id`, `media_label`, `media_type` and `media_player_type` fields. |
| `play_id` | The unique identifier for each individual play of media content. This is the `mediaSessionId` from the media session entity if enabled. Otherwise this uses the page/screen view identifier together with the `media_identifer` to generate a unique play id. |
| `media_ad_id` | Generated identifier that identifies an ad (identified using the `ad_id`) played with a specific media (identified using the `media_identifier`) and on a specific platform (based on the `platform` property). |
| `media_ad_view_id` | The unique identifier for each individual ad view. It is generated from the `play_id`, `ad_break_id` and `media_ad_id` fields. |


## Mixing web and mobile events

The package makes no distinction between events tracked from the web and those tracked from a mobile application, so long as you are tracking media events and from allowed `app_id`s. The `sessionId` from the `client_session` context, and the `id` from the `mobile_screen` context, overwrite the `session_identifier` and `page_view_id` fields respectively in our intermediate and derived tables, for events where they are populated. If you are just using web events, the package will work out the box. If you are using a mix of web and mobile events, you will need to set the `snowplow__enable_mobile_events` package variable to `true` and events will be processed from both sources. If you are only tracking mobile events, you can set the `snowplow__enable_web_events` to `false`.
The package makes no distinction between events tracked from the web and those tracked from a mobile application, so long as you are tracking media events and from allowed `app_id`s. The `sessionId` from the `client_session` context, and the `id` from the `mobile_screen` context, overwrite the `domain_sessionid_array` and `page_view_id` fields respectively in our intermediate and derived tables, for events where they are populated. If you are just using web events, the package will work out the box. If you are using a mix of web and mobile events, you will need to set the `snowplow__enable_mobile_events` package variable to `true` and events will be processed from both sources. If you are only tracking mobile events, you can set the `snowplow__enable_web_events` to `false`.

## Custom models

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,18 @@ title: "Media Player"
sidebar_position: 400
---

### Upgrading to 0.7.0
**This version requires a [full refresh run](/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-operation/full-or-partial-refreshes/#complete-refresh-of-snowplow-package) if you have been using any previous versions.** You will not be able to upgrade and have the package work without doing a full refresh.

**Breaking changes:**

- A new and more robust `media_identifier` field to replace using `media_id` as a key in the derived tables.
- The introduction of new base macro functionality means in places the session and user identifier fields have been renamed to `session_identifier` and `user_identifier`.
- The default session identifier has been updated from using the `domain_sessionid`, to now be the media session id (or the page/screen view id if the media session entity is not set).
- Adds a primary key, `media_ad_view_id`, to the ad views table.

### Upgrading to 0.6.0
**This version requires a full refresh run if you have been using any previous versions.** You will not be able to upgrade and have the package work without doing a full refresh.
**This version requires a [full refresh run](/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-operation/full-or-partial-refreshes/#complete-refresh-of-snowplow-package) if you have been using any previous versions.** You will not be able to upgrade and have the package work without doing a full refresh.

Please [check the quickstart](/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-quickstart/media-player/index.md) for a guide on which new configuration options to enable. If you remain tracking events using the HTML5 and YouTube tracking plugins for the JavaScript tracker, you should add the following configuration to your `dbt_project.yml`:

Expand Down
2 changes: 1 addition & 1 deletion src/componentVersions.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const versions = {
dbtSnowplowWeb: '1.0.0',
dbtSnowplowMobile: '1.0.0',
dbtSnowplowUtils: '0.15.1',
dbtSnowplowMediaPlayer: '0.6.1',
dbtSnowplowMediaPlayer: '0.7.0',
dbtSnowplowNormalize: '0.3.3',
dbtSnowplowFractribution: '0.3.6',
dbtSnowplowEcommerce: '0.5.4',
Expand Down
12 changes: 10 additions & 2 deletions src/components/JsonSchemaValidator/Schemas/dbtMediaPlayer_0.6.1.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ export const Schema = {
packageDefault: 'dev',
group: 'Warehouse and Tracker',
},
snowplow__events_table: {
type: 'string',
title: 'Events Table',
description: 'The name of the table that contains your atomic events',
longDescription: 'The name of the table that contains your atomic events.',
packageDefault: 'events',
group: 'Warehouse and Tracker',
},
snowplow__start_date: {
type: 'string',
format: 'date',
Expand All @@ -77,11 +85,11 @@ export const Schema = {
type: 'number',
minimum: 0,
title: 'Session Lookback Window',
longDescription: 'Number of days to limit scan on `snowplow_mobile_base_sessions_lifecycle_manifest` manifest. Exists to improve performance of model when we have a lot of sessions. Should be set to as large a number as practical.',
longDescription: 'Number of days to limit scan on `snowplow_media_player_base_sessions_lifecycle_manifest` manifest. Exists to improve performance of model when we have a lot of sessions. Should be set to as large a number as practical.',
packageDefault: '730',
group: 'Operation and Logic',
description:
'Number of days to limit scan on `snowplow_mobile_base_sessions_lifecycle_manifest` manifest',
'Number of days to limit scan on `snowplow_media_player_base_sessions_lifecycle_manifest` manifest',
},
snowplow__days_late_allowed: {
type: 'number',
Expand Down
Loading

0 comments on commit 51c6626

Please sign in to comment.