Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdYouLike bidAdapter - Add information in bid request #5828

Merged
merged 23 commits into from
Oct 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
32adbfc
Merge remote-tracking branch 'origin/master'
guiann May 29, 2019
140b538
Remove useless bidderCode in bid response
guiann May 29, 2019
1bd5a3a
Merge remote-tracking branch 'guiann-prebid/master'
guiann May 29, 2019
613824c
Merge remote-tracking branch 'origin/master'
guiann Jun 13, 2019
8fb7857
Merge remote-tracking branch 'origin/master'
guiann Jul 18, 2019
21734b3
Merge branch 'master' into adYouLike-handleMultipleSizes
guiann Jul 18, 2019
e4a5f63
send all the available sizes in the bid request
guiann Jul 22, 2019
111dc49
Merge branch 'adYouLike-handleMultipleSizes'
guiann Jul 22, 2019
908eaab
Merge remote-tracking branch 'origin/master'
guiann Jul 22, 2019
edf4cd3
Use the banner sizes if given
guiann Jul 25, 2019
008ded4
avoid compatibility issue with old bid format
guiann Jul 25, 2019
9664b1a
Merge remote-tracking branch 'origin/master'
guiann Oct 10, 2019
b46765a
Merge remote-tracking branch 'Adyoulike/master'
guiann Dec 24, 2019
1a4f452
Merge remote-tracking branch 'Adyoulike/master'
guiann Dec 24, 2019
c8cf2fc
Merge remote-tracking branch 'origin/master'
guiann Jan 8, 2020
24af97c
Merge remote-tracking branch 'origin/master'
guiann Jan 8, 2020
f945f2a
Merge remote-tracking branch 'origin/master'
guiann Apr 14, 2020
6440311
Merge remote-tracking branch 'Adyoulike/master'
guiann Oct 5, 2020
6844fab
ad iframe and publisher domain paramters to bid requests
guiann Oct 5, 2020
679c963
add publisher domain info in ad request
guiann Oct 6, 2020
5a44ef4
add a check in unit tests for publisherDomain
guiann Oct 6, 2020
4188bb5
Merge branch 'AYL-addIframeInfo'
guiann Oct 6, 2020
8dda59f
encode uri components
guiann Oct 6, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions modules/adyoulikeBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as utils from '../src/utils.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { config } from '../src/config.js';
import find from 'core-js-pure/features/array/find.js';

const VERSION = '1.0';
Expand Down Expand Up @@ -104,15 +105,6 @@ function getHostname(bidderRequest) {
return '';
}

/* Get current page referrer url */
function getReferrerUrl(bidderRequest) {
let referer = '';
if (bidderRequest && bidderRequest.refererInfo) {
referer = bidderRequest.refererInfo.referer;
}
return referer;
}

/* Get current page canonical url */
function getCanonicalUrl() {
let link;
Expand Down Expand Up @@ -155,16 +147,26 @@ function createEndpoint(bidRequests, bidderRequest) {
function createEndpointQS(bidderRequest) {
const qs = {};

const ref = getReferrerUrl(bidderRequest);
if (ref) {
qs.RefererUrl = encodeURIComponent(ref);
if (bidderRequest) {
const ref = bidderRequest.refererInfo;
if (ref) {
qs.RefererUrl = encodeURIComponent(ref.referer);
if (ref.numIframes > 0) {
qs.SafeFrame = true;
}
}
}

const can = getCanonicalUrl();
if (can) {
qs.CanonicalUrl = encodeURIComponent(can);
}

const domain = config.getConfig('publisherDomain');
if (domain) {
qs.PublisherDomain = encodeURIComponent(domain);
}

return qs;
}

Expand Down
1 change: 1 addition & 0 deletions test/spec/modules/adyoulikeBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ describe('Adyoulike Adapter', function () {
expect(request.method).to.equal('POST');
expect(request.url).to.contains('CanonicalUrl=' + encodeURIComponent(canonicalUrl));
expect(request.url).to.contains('RefererUrl=' + encodeURIComponent(referrerUrl));
expect(request.url).to.contains('PublisherDomain=http%3A%2F%2Flocalhost%3A9876');

expect(payload.Version).to.equal('1.0');
expect(payload.Bids['bid_id_0'].PlacementID).to.be.equal('placement_0');
Expand Down