-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Combined iOS and Android ad experience controls documentation into a single file #5150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
bretg
merged 6 commits into
prebid:master
from
charles-the-developer:merge-prebid-mobile-ad-experience-controls-documentation
Apr 4, 2024
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
641f27c
finished merging Android & iOS Ad Experience Controls documentation
charles-the-developer 36c8de9
removed excess whitespace
charles-the-developer 01acb21
added blank lines to fenced code blocks
charles-the-developer e8c028b
shifting no_toc up
bretg 6e3bc75
removing separate files
bretg d6098b1
removed server-pending note
bretg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<ul class="nav nav-tabs" role="tablist"> | ||
<li class="nav-item ui-tab" role="presentation"> | ||
<button class="nav-link active" id="{{ include.id }}-kotlin-tab" data-toggle="tab" data-target="#{{ include.id }}-kotlin" type="button" role="tab" aria-controls="kotlin" aria-selected="true">Android</button> | ||
</li> | ||
<li class="nav-item ui-tab" role="presentation"> | ||
<button class="nav-link" id="{{ include.id }}-swift-tab" data-toggle="tab" data-target="#{{ include.id }}-swift" type="button" role="tab" aria-controls="swift" aria-selected="false">iOS</button> | ||
</li> | ||
</ul> | ||
<div class="tab-content" id="code-tab-content"> | ||
<div class="tab-pane fade show active" id="{{ include.id }}-kotlin" role="tabpanel" aria-labelledby="{{ include.id }}-kotlin-tab"> | ||
{{ include.kotlin | markdownify }} | ||
</div> | ||
<div class="tab-pane fade" id="{{ include.id }}-swift" role="tabpanel" aria-labelledby="{{ include.id }}-swift-tab"> | ||
{{ include.swift | markdownify }} | ||
</div> | ||
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
319 changes: 319 additions & 0 deletions
319
prebid-mobile/modules/rendering/combined-ad-experience-controls.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,319 @@ | ||
--- | ||
|
||
layout: page_v2 | ||
title: Ad Experience Controls | ||
description: Customization of ad expirience | ||
sidebarType: 2 | ||
|
||
--- | ||
|
||
# Ad Experience Controls | ||
{:.no_toc} | ||
|
||
If you use Prebid SDK to render the winning bid you can customize behaviour using the following API. | ||
|
||
> NOTE: Planned future enhancements will support Server Side Configuration. Follow this [feature request](https://github.com/prebid/prebid-server/issues/2186) for the details. | ||
|
||
* TOC | ||
{:toc} | ||
|
||
## Rendering Controls | ||
|
||
The following properties enable rendering customization of Video Interstitial Ads. | ||
|
||
### Max Video Duration | ||
|
||
This setting determines the longest video duration allowed, measured in seconds. When using the Prebid SDK, this value is sent in the `imp.video.maxduration` object of the bid request. If the `<Duration>` in the VAST tag received is longer than this set maximum, the SDK won't load the video file, the ad won't load, and an error message will appear. | ||
|
||
{% capture android %} | ||
{: .table .table-bordered .table-striped } | ||
|**API Object** | `InterstitialAdUnit`, `RewardedAdUnit`, <br />`MediationInterstitialAdUnit`, `MediationRewardedVideoAdUnit` | | ||
|**Ad Unit Property** | `adUnit.setMaxVideoDuration(seconds)`| | ||
|**Server Property** | `maxvideoduration` *(pending for PBS implementation)*| | ||
|**Default Value** | `3600 seconds`| | ||
{% endcapture %} | ||
{% capture ios %} | ||
{: .table .table-bordered .table-striped } | ||
|**API Object** |`InterstitialRenderingAdUnit`, `RewardedAdUnit`, <br />`MediationInterstitialAdUnit`, `MediationRewardedAdUnit` | | ||
|**Ad Unit Property** | `adUnit.videoParameters.maxDuration`| | ||
|**Server Property** | `maxvideoduration` *(pending for PBS implementation)*| | ||
|**Default Value** | `3600 seconds`| | ||
{% endcapture %} | ||
|
||
{% include code/mobile-sdk.html id="max-video-duration" kotlin=android swift=ios %} | ||
|
||
### Application Muted | ||
|
||
This option lets you switch the sound on or off during playback. | ||
|
||
{% capture android %} | ||
{: .table .table-bordered .table-striped } | ||
|**API Object** | `InterstitialAdUnit`, `RewardedAdUnit`, <br />`MediationInterstitialAdUnit`, `MediationRewardedVideoAdUnit` | | ||
|**Ad Unit Property** | `adUnit.setIsMuted(true)`| | ||
|**Server Property** | `ismuted` *(pending for PBS implementation)*| | ||
|**Default Value** | `false`| | ||
{% endcapture %} | ||
{% capture ios %} | ||
{: .table .table-bordered .table-striped } | ||
|**API Object** |`InterstitialRenderingAdUnit`, `RewardedAdUnit`, <br />`MediationInterstitialAdUnit`, `MediationRewardedAdUnit` | | ||
|**Ad Unit Property** | `adUnit.isMuted`| | ||
|**Server Property** | `ismuted` *(pending for PBS implementation)*| | ||
|**Default Value** | `false`| | ||
{% endcapture %} | ||
|
||
{% include code/mobile-sdk.html id="application-muted" kotlin=android swift=ios %} | ||
|
||
### Close Button Area | ||
|
||
This setting determines the percentage of the device screen that the close button should cover. | ||
|
||
{% capture android %} | ||
{: .table .table-bordered .table-striped } | ||
|**API Object** | `InterstitialAdUnit`, `RewardedAdUnit`, <br />`MediationInterstitialAdUnit`, `MediationRewardedVideoAdUnit` | | ||
|**Ad Unit Property** | `adUnit.setCloseButtonArea(factor)`| | ||
|**Server Property** | `closebuttonarea` *(pending for PBS implementation)*| | ||
|**Allowed Values** | `0..1`| | ||
|**Default Size** | `70dp`| | ||
|
||
Customization Example | ||
|
||
{: .table .table-bordered .table-striped } | ||
|
||
|**Default**|**Custom**| | ||
|{:width="250px"}|{:width="250px"}| | ||
{% endcapture %} | ||
|
||
{% capture ios %} | ||
{: .table .table-bordered .table-striped } | ||
|**API Object** |`InterstitialRenderingAdUnit`, `RewardedAdUnit`, <br />`MediationInterstitialAdUnit`, `MediationRewardedAdUnit` | | ||
|**Ad Unit Property** | `adUnit.closeButtonArea`| | ||
|**Server Property** | `closebuttonarea` *(pending for PBS implementation)*| | ||
|**Allowed Values** | `0..1`| | ||
|**Default Value** | `0.1`| | ||
|
||
Customization Example | ||
|
||
{: .table .table-bordered .table-striped } | ||
|
||
|**Default**|**Custom**| | ||
|{:width="250px"}|{:width="250px"}| | ||
{% endcapture %} | ||
|
||
{% include code/mobile-sdk.html id="close-button-area" kotlin=android swift=ios %} | ||
|
||
### Close Button Position | ||
|
||
This setting controls where the close button appears on the screen. | ||
|
||
{% capture android %} | ||
{: .table .table-bordered .table-striped } | ||
|
||
|**API Object** |`InterstitialAdUnit`, `RewardedAdUnit`, <br />`MediationInterstitialAdUnit`, `MediationRewardedVideoAdUnit` | | ||
|**Ad Unit Property** | `adUnit.setCloseButtonPosition(Position.TOP_LEFT)`| | ||
|**Server Property** | `closebuttonposition` *(pending for PBS implementation)*| | ||
|**Allowed Values** | `Position.TOP_LEFT, Position.TOP_RIGHT`| | ||
|**Default Value** | `Position.TOP_RIGHT`| | ||
|
||
Customization Example | ||
|
||
{: .table .table-bordered .table-striped } | ||
|
||
|**Default**|**Custom**| | ||
|{:width="250px"}|{:width="250px"}| | ||
{% endcapture %} | ||
|
||
{% capture ios %} | ||
{: .table .table-bordered .table-striped } | ||
|
||
|**API Object** |`InterstitialRenderingAdUnit`, `RewardedAdUnit`, <br />`MediationInterstitialAdUnit`, `MediationRewardedAdUnit` | | ||
|**Ad Unit Property** | `adUnit.closeButtonPosition`| | ||
|**Server Property** | `closebuttonposition` *(pending for PBS implementation)*| | ||
|**Allowed Values** | `topLeft, topRight`| | ||
|**Default Value** | `topRight`| | ||
|
||
Customization Example | ||
|
||
{: .table .table-bordered .table-striped } | ||
|
||
|**Default**|**Custom**| | ||
|{:width="250px"}|{:width="250px"}| | ||
{% endcapture %} | ||
|
||
{% include code/mobile-sdk.html id="close-button-position" kotlin=android swift=ios %} | ||
|
||
### Skip Button Area | ||
|
||
This setting determines the percentage of the device screen that the skip button should cover. | ||
|
||
{% capture android %} | ||
{: .table .table-bordered .table-striped } | ||
|
||
|**API Object** |`InterstitialAdUnit`, `RewardedAdUnit`, <br />`MediationInterstitialAdUnit`, `MediationRewardedVideoAdUnit` | | ||
|**Ad Unit Property** | `adUnit.setSkipButtonArea(factor)`| | ||
|**Server Property** | `skipbuttonarea` *(pending for PBS implementation)*| | ||
|**Allowed Values** | `0..1`| | ||
|**Default Value** | `70dp`| | ||
{% endcapture %} | ||
|
||
{% capture ios %} | ||
{: .table .table-bordered .table-striped } | ||
|
||
|**API Object** |`InterstitialRenderingAdUnit`, `RewardedAdUnit`, <br />`MediationInterstitialAdUnit`, `MediationRewardedAdUnit` | | ||
|**Ad Unit Property** | `adUnit.skipButtonArea`| | ||
|**Server Property** | `skipbuttonarea` *(pending for PBS implementation)*| | ||
|**Allowed Values** | `0..1`| | ||
|**Default Value** | `0.1`| | ||
{% endcapture %} | ||
|
||
{% include code/mobile-sdk.html id="skip-button-area" kotlin=android swift=ios %} | ||
|
||
Customization Example | ||
|
||
{: .table .table-bordered .table-striped } | ||
|
||
|**Default**|**Custom**| | ||
|{:width="250px"}|{:width="250px"}| | ||
|
||
### Skip Button Position | ||
|
||
This control sets the position of the skip button. | ||
|
||
{% capture android %} | ||
{: .table .table-bordered .table-striped } | ||
|
||
|**API Object** |`InterstitialAdUnit`, `RewardedAdUnit`, <br />`MediationInterstitialAdUnit`, `MediationRewardedVideoAdUnit` | | ||
|**Ad Unit Property** | `adUnit.setSkipButtonPosition(Position.TOP_LEFT)`| | ||
|**Server Property** | `skipbuttonposition` *(pending for PBS implementation)*| | ||
|**Allowed Values** | `Position.TOP_LEFT, Position.TOP_RIGHT`| | ||
|**Default Value** | `Position.TOP_RIGHT`| | ||
|
||
Customization Example | ||
|
||
{: .table .table-bordered .table-striped } | ||
|
||
|**Default**|**Custom**| | ||
|{:width="250px"}|{:width="250px"}| | ||
{% endcapture %} | ||
|
||
{% capture ios %} | ||
{: .table .table-bordered .table-striped } | ||
|
||
|**API Object** |`InterstitialRenderingAdUnit`, `RewardedAdUnit`, <br />`MediationInterstitialAdUnit`, `MediationRewardedAdUnit` | | ||
|**Ad Unit Property** | `adUnit. skipButtonPosition`| | ||
|**Server Property** | `skipbuttonposition` *(pending for PBS implementation)*| | ||
|**Allowed Values** | `topLeft, topRight`| | ||
|**Default Value** | `topLeft`| | ||
|
||
Customization Example | ||
|
||
{: .table .table-bordered .table-striped } | ||
|
||
|**Default**|**Custom**| | ||
|{:width="250px"}|{:width="250px"}| | ||
{% endcapture %} | ||
|
||
{% include code/mobile-sdk.html id="skip-button-position" kotlin=android swift=ios %} | ||
|
||
### Skip Delay | ||
|
||
This setting determines the number of seconds after the start of playback before the skip or close button should appear. | ||
|
||
{% capture android %} | ||
{: .table .table-bordered .table-striped } | ||
|
||
|**API Object** |`InterstitialAdUnit`, `RewardedAdUnit`, <br />`MediationInterstitialAdUnit`, `MediationRewardedVideoAdUnit` | | ||
|**Ad Unit Property** | `adUnit.setSkipDelay(seconds)`| | ||
|**Server Property** | `skipdelay` *(pending for PBS implementation)*| | ||
|**Default Value** | `10 seconds`| | ||
{% endcapture %} | ||
|
||
{% capture ios %} | ||
{: .table .table-bordered .table-striped } | ||
|
||
|**API Object** |`InterstitialRenderingAdUnit`, `RewardedAdUnit`, <br />`MediationInterstitialAdUnit`, `MediationRewardedAdUnit` | | ||
|**Ad Unit Property** | `adUnit.skipDelay`| | ||
|**Server Property** | `skipdelay` *(pending for PBS implementation)*| | ||
|**Default Value** | `10 seconds`| | ||
{% endcapture %} | ||
|
||
{% include code/mobile-sdk.html id="skip-delay" kotlin=android swift=ios %} | ||
|
||
### Sound Button | ||
|
||
This option switches on or off the visibility of the sound/mute button for users. | ||
|
||
{% capture android %} | ||
{: .table .table-bordered .table-striped } | ||
|
||
|**API Object** |`InterstitialAdUnit`, `RewardedAdUnit`, <br />`MediationInterstitialAdUnit`, `MediationRewardedVideoAdUnit` | | ||
|**Ad Unit Property** | `adUnit.setIsSoundButtonVisible(true)`| | ||
|**Server Property** | *not supported*| | ||
|**Default Value** | `false`| | ||
|
||
Customization Example | ||
|
||
{: .table .table-bordered .table-striped } | ||
|
||
|**Custom**| | ||
|{:width="250px"}| | ||
{% endcapture %} | ||
|
||
{% capture ios %} | ||
{: .table .table-bordered .table-striped } | ||
|
||
|**API Object** |`InterstitialRenderingAdUnit`, `RewardedAdUnit`, <br />`MediationInterstitialAdUnit`, `MediationRewardedAdUnit` | | ||
|**Ad Unit Property** | `adUnit.isSoundButtonVisible`| | ||
|**Server Property** | *not supported*| | ||
|**Default Value** | `false`| | ||
|
||
Customization Example | ||
|
||
{: .table .table-bordered .table-striped } | ||
|
||
|**Default**|**Custom**| | ||
|{:width="250px"}|{:width="250px"}| | ||
{% endcapture %} | ||
|
||
{% include code/mobile-sdk.html id="sound-button" kotlin=android swift=ios %} | ||
|
||
### Code Example | ||
|
||
Here is how you can implement all the API's to customize your ad. | ||
|
||
{% capture android %} | ||
|
||
```kotlin | ||
adUnit = MediationInterstitialAdUnit( | ||
activity, | ||
configId, | ||
EnumSet.of(AdUnitFormat.BANNER), | ||
mediationUtils | ||
) | ||
|
||
adUnit?.setMaxVideoDuration(30) | ||
adUnit?.setCloseButtonArea(0.1) | ||
adUnit?.setSkipDelay(5) | ||
adUnit?.setSkipButtonArea(0.1) | ||
adUnit?.setSkipButtonPosition(Position.TOP_RIGHT) | ||
adUnit?.setCloseButtonPosition(Position.TOP_LEFT) | ||
``` | ||
|
||
{% endcapture %} | ||
|
||
{% capture ios %} | ||
|
||
```swift | ||
interstitialController = InterstitialRenderingAdUnit(configID: prebidConfigId, | ||
minSizePercentage: CGSize(width: 30, height: 30)) | ||
interstitialController?.delegate = self | ||
interstitialController?.videoParameters.maxDuration = SingleContainerInt(integerLiteral: 30) | ||
interstitialController?.closeButtonArea = 0.1 | ||
interstitialController?.skipDelay = 5 | ||
interstitialController?.skipButtonArea = 0.1 | ||
interstitialController?.skipButtonPosition = .topRight | ||
interstitialController?.closeButtonPosition = .topRight | ||
``` | ||
|
||
{% endcapture %} | ||
|
||
{% include code/mobile-sdk.html id="code-example" kotlin=android swift=ios %} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@YuriyVelichkoPI - I assume this is the
bidrequest.ext.prebid.passthrough
feature? Is there anything in this doc that should change as a result of this being done in PBS now besides removing this note?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @bretg ! Yes it is about
bidrequest.ext.prebid.passthrough
. And yes - the doc should contain config keys to change the properties viapassthrough
. Missing this info in the documentation is our gap. I'll create a ticket to highlight the changes.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically, the properties are already in the doc. They are listed in the
Server Property
row for each section. But we still should remove(pending for PBS implementation)
text for them.