Configure OMID (Android)
Enable third-party viewability, verification measurement, and vendor restrictions through the Open Measurement Interface Definition.
The Android SDK includes support for the Open Measurement Interface Definition (OMID).
By default, Open Measurement functionality is enabled for both VAST and Google IMA. OMID permits several ad-related features:
- Third-party viewability
- Verification measurement
- (VAST only) Vendor restrictions
Requirements
The ad response must contain an AdVerifications
node.
<AdVerifications>
<Verification vendor="vendor.com-omid">
<JavaScriptResource apiFramework="omid" browserOptional="true">
<![CDATA[https://vendor.com/omidscript.js]]></JavaScriptResource>
<TrackingEvents>
<Tracking event="verificationNotExecuted">
<![CDATA[https://vendor.com/blank.gif?track=verificationnotexecuted&reason=[REASON]&cbm=1918994]]></Tracking>
</TrackingEvents>
<VerificationParameters><![CDATA["vendor.com-Test"]]></VerificationParameters>
</Verification>
</AdVerifications>
Customize OMID for VAST
OMID functionality is enabled by default for VAST, however you can use the following steps to customize the Open Measurement functionality:
-
(Optional) Create an array of vendors allowed to execute scripts within the
AdVerifications
. If a verification script from an unauthorized vendor is found within an ad, theverificationNotExecuted
script will be executed for the ad as per Open Measurementβs standard. If not defined, all vendors are assumed to be approved. -
Use
OmidConfig.Builder()
to create an Open Measurement config,OmidConfig
. If defined in the previous step, be sure to pass the array of vendors allowed to execute scripts. -
Use
VastAdvertisingConfig.Builder()
to add theOmidConfig
to theVastAdvertisingConfig
object.List<String> allowedVendors = new ArrayList<>(); allowedVendors.add("my-vendor"); OmidConfig omidConfig = new OmidConfig.Builder() .allowedVendors(allowedVendors) .build(); VastAdvertisingConfig vast = new VastAdvertisingConfig.Builder() .schedule(adBreaks) .omidConfig(omidConfig) .build(); PlayerConfig playerConfig = new PlayerConfig.Builder() .playlistUrl("https://cdn.jwplayer.com/v2/media/{media_id}?format=json") .advertisingConfig(vast) .build();
Disable OMID
The IAB recommends implementing a kill switch to permit disabling OMID when a bad creative or verification data has been detected.
VAST
To disable OMID, set isOmidEnabled(false)
.
OmidConfig omidConfig = new OmidConfig.Builder()
.isOmidEnabled(false)
.build();
Google IMA
To disable OMID, configure your ad server to not deliver the AdVerifications
node. Contact your ad server representative for assistance.
Updated about 1 year ago