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

ucfunnel adapter update request parameter #5278

Merged
merged 46 commits into from
Jun 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
d18db95
Add a new ucfunnel Adapter and test page
Jun 5, 2017
f82a4b7
Add a new ucfunnel Adapter and test page
Jun 5, 2017
4c91775
1. Use prebid lib in the repo to keep updated
RyanChouTw Jun 16, 2017
52eaecb
Merge branch 'master' into master
RyanChouTw Jun 16, 2017
96a70a4
utils.getTopWindowLocation is a function
RyanChouTw Jun 20, 2017
7202a62
Merge branch 'master' of https://github.com/prebid/Prebid.js
RyanChouTw Jun 28, 2017
858b833
Change to modules from adapters
RyanChouTw Jun 28, 2017
8b46932
Migrate to module design
RyanChouTw Jun 28, 2017
d7e043b
[Dev Fix] Remove width and height which can be got from ad unit id
RyanChouTw Jul 13, 2017
badfa53
Merge branch 'master' of https://github.com/prebid/Prebid.js
RyanChouTw Jul 13, 2017
8d81704
Merge pull request #1 from prebid/master
RyanChouTw Sep 25, 2017
8e7fe31
Merge branch 'master' of https://github.com/prebid/Prebid.js
RyanChouTw Dec 21, 2017
5dc00f3
Update ucfunnelBidAdapter to fit into new spec
RyanChouTw Dec 21, 2017
66c3a06
Correct the endpoint. Fix the error of query string
RyanChouTw Dec 21, 2017
0328e97
Add test case for ucfunnelBidAdapter
RyanChouTw Jan 11, 2018
c2c5eb0
Merge branch 'master' of https://github.com/prebid/Prebid.js
RyanChouTw Jan 11, 2018
86fdd23
Fix lint error
RyanChouTw Jan 12, 2018
c331f57
Update version number
RyanChouTw Jan 16, 2018
28acb40
Combine all checks on bid request
RyanChouTw Jan 18, 2018
93621b8
Merge branch 'master' of https://github.com/prebid/Prebid.js
RyanChouTw May 25, 2018
f7f2515
Add GDPR support for ucfunnel adapter
RyanChouTw May 25, 2018
d4f3467
Merge branch 'master' of https://github.com/prebid/Prebid.js
RyanChouTw Jun 14, 2018
1f79c44
Add in-stream video and native support for ucfunnel adapter
RyanChouTw Jun 14, 2018
7d8dc52
Remove demo page. Add more test cases.
RyanChouTw Jun 20, 2018
99fa86e
Change request method from POST to GET
RyanChouTw Jun 26, 2018
03e37e6
Remove unnecessary comment
RyanChouTw Jun 27, 2018
aabfdd4
Support vastXml and vastUrl for video request
RyanChouTw Jul 3, 2018
2177c15
Merge branch 'master' of https://github.com/prebid/Prebid.js
Dec 2, 2018
af05d07
update TTL to 30 mins
Dec 2, 2018
45614c9
Avoid using arrow function which is not discuraged in mocha
Dec 3, 2018
a5b402c
Merge branch 'master' of https://github.com/prebid/Prebid.js
Jul 9, 2019
c22723e
ucfunnel tdid support
Jul 9, 2019
644b900
Merge branch 'master' of https://github.com/prebid/Prebid.js into HEAD
Oct 21, 2019
0175c57
ucfunnel fix error message in debug mode
Oct 17, 2019
70e82bb
Merge branch 'master' of https://github.com/prebid/Prebid.js
jackhsiehucf Nov 25, 2019
c09b816
ucfunnel adapter add bidfloor parameter
jackhsiehucf Nov 25, 2019
30e79c5
Merge branch 'master' of https://github.com/prebid/Prebid.js into ccpa
jackhsiehucf Dec 5, 2019
fee3803
ucfunnel adapter support CCPA
jackhsiehucf Dec 5, 2019
0f9b6c8
ucfunnel adapter fix prebid 3.0 problem
jackhsiehucf Dec 12, 2019
eb11188
merge
jackhsiehucf Jan 9, 2020
994ffef
Merge branch 'master' of https://github.com/prebid/Prebid.js
jackhsiehucf Jan 9, 2020
084190b
ucfunnel adapter native support clicktrackers
jackhsiehucf Jan 10, 2020
ddb077d
Merge branch 'master' of https://github.com/prebid/Prebid.js
jackhsiehucf Jan 17, 2020
bb22940
ucfunnel adapter change cookie sync setting
jackhsiehucf Jan 17, 2020
3004ad9
Merge branch 'master' of https://github.com/prebid/Prebid.js
jackhsiehucf May 21, 2020
f34f753
ucfunnel adapter update request parameter
jackhsiehucf May 21, 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
36 changes: 30 additions & 6 deletions modules/ucfunnelBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import {registerBidder} from '../src/adapters/bidderFactory.js';
import {BANNER, VIDEO, NATIVE} from '../src/mediaTypes.js';

import { getStorageManager } from '../src/storageManager.js';
import * as utils from '../src/utils.js';
const storage = getStorageManager();
const COOKIE_NAME = 'ucf_uid';
const VER = 'ADGENT_PREBID-2018011501';
const BIDDER_CODE = 'ucfunnel';

Expand Down Expand Up @@ -183,9 +186,6 @@ function getSupplyChain(schain) {

function getRequestData(bid, bidderRequest) {
const size = parseSizes(bid);
const loc = window.location;
const host = loc.host;
const page = loc.href;
const language = navigator.language;
const dnt = (navigator.doNotTrack == 'yes' || navigator.doNotTrack == '1' || navigator.msDoNotTrack == '1') ? 1 : 0;
const userIdTdid = (bid.userId && bid.userId.tdid) ? bid.userId.tdid : '';
Expand All @@ -197,14 +197,38 @@ function getRequestData(bid, bidderRequest) {
bl: language,
je: 1,
dnt: dnt,
host: host,
u: page,
adid: bid.params.adid,
tdid: userIdTdid,
schain: supplyChain,
fp: bid.params.bidfloor
};

try {
bidData.host = window.top.location.hostname;
bidData.u = window.top.location.href;
bidData.xr = 0;
} catch (e) {
bidData.host = window.location.hostname;
bidData.u = document.referrer || window.location.href;
bidData.xr = 1;
}

if (window.location.ancestorOrigins && window.location.ancestorOrigins.length > 0) {
aleksatr marked this conversation as resolved.
Show resolved Hide resolved
bidData.ao = window.location.ancestorOrigins[window.location.ancestorOrigins.length - 1];
}

if (storage.cookiesAreEnabled()) {
let ucfUid = '';
if (storage.getCookie(COOKIE_NAME) != undefined) {
ucfUid = storage.getCookie(COOKIE_NAME);
bidData.ucfUid = ucfUid;
} else {
ucfUid = utils.generateUUID();
bidData.ucfUid = ucfUid;
storage.setCookie(COOKIE_NAME, ucfUid);
}
}

if (size != undefined && size.length == 2) {
bidData.w = size[0];
bidData.h = size[1];
Expand Down
18 changes: 18 additions & 0 deletions test/spec/modules/ucfunnelBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,4 +250,22 @@ describe('ucfunnel Adapter', function () {
});
});
});

describe('cookie sync', function () {
describe('cookie sync iframe', function () {
const result = spec.getUserSyncs({'iframeEnabled': true});

it('should return cookie sync iframe info', function () {
expect(result[0].type).to.equal('iframe');
expect(result[0].url).to.equal('https://cdn.aralego.net/ucfad/cookie/sync.html');
});
});
describe('cookie sync image', function () {
const result = spec.getUserSyncs({'pixelEnabled': true});
it('should return cookie sync image info', function () {
expect(result[0].type).to.equal('image');
expect(result[0].url).to.equal('https://sync.aralego.com/idSync');
});
});
});
});