Important note: For testing your AppLixir integration, you must use 2050 as your Zone ID. Using a production zone ID for testing can result in your domain being blocked by the ad servers since it looks like ad fraud. Zone 2050 will be available until you've finished testing and your production zone ID is enabled so remember to switch to your production zone ID before you go live since test ads do not generate revenue.
Note : You must also provide a valid UUID value for options.userId or the ad servers will significantly reduce your CPM rates. (see below for more details)
1. Call invokeApplixirVideoUnit in the onClick handler of the button your customers use to watch reward videos. This will load the video and start playing it. Call invokeApplixirVideoUnit from inside an onClick handler as follows:
<script type=’application/javascript’>
var options = {
zoneId: 2050,
userId: <UUID4>, UUID4 recommended
adStatusCb: adStatusCallback
};
<button type="button" id="showRewardAdButton">Show Reward Ad</button>
function adStatusCallback(status) {
console.log('Ad Status: ' + status);
}
showRewardAdButton.onClick =
function () {
invokeApplixirVideoUnit(options); //play the video ad
};
</script>
Note:
- Calling the method invokeApplixirVideoUnit from within an onClick handler is a requirement of the user permission rules for video ads, enforced by all browsers. If this isn't done, your ads will be blocked and you will receive a 4xx error.
- Any subsequent calls to invokeApplixirVideoUnit should occur no sooner than 1-3 mins after the ‘sys-closing’ event has been received. If you are using Reward Management system, then it should occur no sooner than the setting you selected for “time between callbacks”.
- Please refer to the "Media Player Option" Tab to understand the details on how AppLixir Media Player works / gets customized.
Few other events
- RMS call failed, invalid userId // This is due to someone implementing RMS and not providing valid user ID (we recommend UUID4).
- "Value in options.userId not a valid UUID. Setting ppid to new UUIDv4" // From not setting a valid UUID in options.userId, (causes low CPM rates)
- "Setting ppid to current options.userId" // This is good, it means they have passed a valid UUID in options.userId so ads can be properly targeted.