Skip to content

Commit

Permalink
AdYouLike Bid Adapter : fix page and ref Url values (prebid#9109)
Browse files Browse the repository at this point in the history
* add required clickurl in every native adrequest

* allows the native response to be given as is to prebid if possible

* add unit tests on new Native case

* Handle meta object in bid response with default addomains array

* fix icon retrieval in Native case

* Update priorities in case of multiple mediatypes given

* improve robustness and fix associated unit test on picture urls

* add support for params.size parameter

* add unit test on new size format

* Makes sure the playerSize format is consistent

* enable Vast response on bidder adapter

* fix lint errors

* add test on Vast format case

* add userId to bidrequest

* revert package-lock.json changes

* improve multiple mediatype handling

* Expose adyoulike GVL id

* fix icurl issue when retreiving icon for Native mediatype

* update unit tests on icon url in native mediatype

* target video endpoint when video mediatype is present

* add unit test on video endpoint

* detect if bid request has video

* remove console log

* Add size information in Video bid + unit tests

* Remove unused method (old video retrieval)

* update pagereferrer and pageUrl values

* improve null robustness in native getAssetValue

* change function body and add unit test

* fix pageUrl in case not given i ortb2

* adjust pageUrl and referrer values

* add unit tests on new priority behaviour

Co-authored-by: GuillaumeA <guillaume.andouard@openweb.com>
  • Loading branch information
2 people authored and JacobKlein26 committed Feb 8, 2023
1 parent 5875e5e commit 3a1e955
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
18 changes: 12 additions & 6 deletions modules/adyoulikeBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,17 +227,23 @@ function createEndpointQS(bidderRequest) {
const qs = {};
if (bidderRequest) {
const ref = bidderRequest.refererInfo;
if (ref?.location) {
// RefererUrl will be removed in a future version.
qs.RefererUrl = encodeURIComponent(ref.location);
if (ref.numIframes > 0) {
qs.SafeFrame = true;
if (ref) {
if (ref.location) {
// RefererUrl will be removed in a future version.
qs.RefererUrl = encodeURIComponent(ref.location);
if (!ref.reachedTop) {
qs.SafeFrame = true;
}
}

qs.PageUrl = encodeURIComponent(ref.topmostLocation);
qs.PageReferrer = encodeURIComponent(ref.location);
}

// retreive info from ortb2 object if present (prebid7)
const siteInfo = bidderRequest.ortb2?.site;
if (siteInfo) {
qs.PageUrl = encodeURIComponent(siteInfo.page);
qs.PageUrl = encodeURIComponent(siteInfo.page || ref?.topmostLocation);
qs.PageReferrer = encodeURIComponent(siteInfo.ref || ref?.location);
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/adyoulikeBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('Adyoulike Adapter', function () {
consentString: consentString,
gdprApplies: true
},
refererInfo: {location: referrerUrl, canonicalUrl, domain},
refererInfo: {location: referrerUrl, canonicalUrl, domain, topmostLocation: 'fakePageURL'},
ortb2: {site: {page: pageUrl, ref: referrerUrl}}
};
const bidRequestWithEmptyPlacement = [
Expand Down

0 comments on commit 3a1e955

Please sign in to comment.