Skip to content

Commit

Permalink
Add changelog and basic documentation for SSAI tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
strangesource committed Jul 3, 2024
1 parent 2ce9997 commit d9b1e4e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased
### Added
- `ConvivaAnalyticsIntegration.ssai` namespace to enable server side ad tracking

### Fixed
- Potential exception when determining the IMA SDK version on ad start
Expand Down
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,37 @@ A session can be ended using following method call:
`convivaAnalyticsIntegration.endSession()`
Since the `BitmovinPlayer` automatically pauses the video if no background playback is configured the session creation after the app is in foreground again is handled automatically.

#### Server Side Ad Tracking

In order to track server side ads you can use the functions provided in `ConvivaAnalyticsIntegration.getSsai()`. The following example shows basic server side ad tracking:
```java
SsaiApi ssai = convivaAnalyticsIntegration.getSsai();

ssai.reportAdBreakStarted();

SsaiApi.AdInfo adInfo = new SsaiApi.AdInfo();
adInfo.setPosition(AdPosition.PREROLL);
adInfo.setTitle("My ad title");
adInfo.setDuration(30);
ssai.reportAdStarted(adInfo);

...

ssai.reportAdFinished();
ssai.reportAdBreakFinished();
```

In addition to the metadata provided in the `AdInfo` object at ad start, the following metadata will be auto collected from the main content metadata:
- ConvivaSdkConstants.STREAM_URL
- ConvivaSdkConstants.ASSET_NAME
- ConvivaSdkConstants.IS_LIVE
- ConvivaSdkConstants.DEFAULT_RESOURCE
- ConvivaSdkConstants.ENCODED_FRAMERATE
- streamType
- integrationVersion

Metadata in the `AdInfo` overwrites all auto collected metadata.

#### Clean up

At end of app instance lifecycle, the convivaAnalyticsIntegration should be released:
Expand Down

0 comments on commit d9b1e4e

Please sign in to comment.