Skip to content

Commit

Permalink
Add video cache key (#2064)
Browse files Browse the repository at this point in the history
* fix media type by assigning it with creative type, create video cache key with the value of impression id

* add unit tests

* fix typo
  • Loading branch information
moonshells authored and jaiminpanchal27 committed Jan 25, 2018
1 parent aa0bee7 commit f838057
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/rubiconBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ export const spec = {
requestId: bidRequest.bidId,
currency: 'USD',
creativeId: ad.creative_id,
mediaType: ad.creative_type,
cpm: ad.cpm || 0,
dealId: ad.deal,
ttl: 300, // 5 minutes
Expand All @@ -275,6 +276,7 @@ export const spec = {
bid.height = bidRequest.params.video.playerHeight;
bid.vastUrl = ad.creative_depot_url;
bid.impression_id = ad.impression_id;
bid.videoCacheKey = ad.impression_id;
} else {
bid.ad = _renderCreative(ad.script, ad.impression_id);
[bid.width, bid.height] = sizeMap[ad.size_id].split('x').map(num => Number(num));
Expand Down
2 changes: 2 additions & 0 deletions test/spec/modules/rubiconBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,8 @@ describe('the rubicon adapter', () => {
'https://fastlane-adv.rubiconproject.com/v1/creative/a40fe16e-d08d-46a9-869d-2e1573599e0c.xml'
);
expect(bids[0].impression_id).to.equal('a40fe16e-d08d-46a9-869d-2e1573599e0c');
expect(bids[0].mediaType).to.equal('video');
expect(bids[0].videoCacheKey).to.equal('a40fe16e-d08d-46a9-869d-2e1573599e0c');
});
});
});
Expand Down

0 comments on commit f838057

Please sign in to comment.