Hi @opinali,
While using the DoubleClickOpenRtbMapper
and testing it with Video requests, I notice that the mapper is not creating Video impressions.
I believe the reason is the following code:
if (dcSlot.getWidthCount() == 1) {
video.setW(dcSlot.getWidth(0));
video.setH(dcSlot.getHeight(0));
} else if (dcSlot.getWidthCount() > 1) {
if (interstitial) {
video.setW(dcSlot.getWidth(0));
video.setH(dcSlot.getHeight(0));
} else {
logger.debug("Invalid Video, non-interstitial with multiple sizes");
return null;
}
}
In that code above, the mapper is returning null
when it is an interstitial request and has multiple-dimensions.
After enabling debug level in the mapper class, I could see several the messages:
...
[DEBUG] 2015-11-04 00:33:31,987 DoubleClickOpenRtbMapper - Invalid Video, non-interstitial with multiple sizes
[DEBUG] 2015-11-04 00:33:31,988 DoubleClickOpenRtbMapper - Request has no impressions
[DEBUG] 2015-11-04 00:33:31,988 DoubleClickOpenRtbMapper - Request has no impressions
[DEBUG] 2015-11-04 00:33:34,561 DoubleClickOpenRtbMapper - Invalid Video, non-interstitial with multiple sizes
[DEBUG] 2015-11-04 00:33:34,561 DoubleClickOpenRtbMapper - Invalid Video, non-interstitial with multiple sizes
[DEBUG] 2015-11-04 00:33:34,561 DoubleClickOpenRtbMapper - Request has no impressions
[DEBUG] 2015-11-04 00:33:34,561 DoubleClickOpenRtbMapper - Request has no impressions
...
So, for my surprise, it seems that AdX is only sending video requests to me that are both interstitial requests and has multiple dimensions - thus the mapper is always returning null
and finishing the translation to OpenRtb with no impressions objects.
Wondering if this is the right approach I went to DoubleClick spec, where it can be read:
...
// For mobile interstitial ads (including ones where video ads are eligible)
// the first width height pair is the screen size (this is also the video
// player size for VAST video ads). Subsequent pairs are recommended
// interstitial ad sizes that satisfy the interstitial size restrictions,
// i.e. no bigger than the screen size and no smaller than 50% of width and
// 40% height.
repeated int32 width = 2;
repeated int32 height = 3;
So, from my understanding, it is possible to have video interstitial requests with multiple dimensions. In that case, we should get the first width and height as they should be the video player size.
Therefore, I would propose the following change:
if (dcSlot.getWidthCount() > 0) {
video.setW(dcSlot.getWidth(0));
video.setH(dcSlot.getHeight(0));
} else {
logger.debug("Invalid Video, dimension of the video player not defined");
return null;
}
And no need for interstitial
argument in the buildVideo
method...
What do you think? Am I missing something?
PS: I did not open a PR as I read in the CONTRIBUTING
file "...It's generally best to start by opening a new issue describing the bug or feature you're intending to fix..."