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

Cookie Sync functionality #4457

Merged
merged 32 commits into from
Nov 14, 2019
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c20da14
nanointeractive bid adapter
Sep 27, 2017
a60630b
nanointeractive bid adapter
Oct 16, 2017
c402746
Merge branch 'master' of https://github.com/prebid/Prebid.js
Oct 16, 2017
acf178f
- using utils.getParameterByName instead of utils.getTopWindowLocatio…
rade-popovic Oct 25, 2017
9f2c50f
markdown file
rade-popovic Oct 25, 2017
1cbdb97
enabling localhost for bid requests
rade-popovic Oct 25, 2017
45cf877
Engine base url change
rade-popovic Jan 26, 2018
bba3b8f
Syncing a fork;
rade-popovic Jan 30, 2018
d181668
Bugfix interpretResponse - added body; Removed unnecessary parameters…
rade-popovic Jan 30, 2018
5c0674b
Merge remote-tracking branch 'upstream/master'
rade-popovic May 3, 2018
180fa1b
New feature - subId
rade-popovic May 4, 2018
6aca7fb
Merge remote-tracking branch 'upstream/master'
rade-popovic May 4, 2018
72998e4
Merge remote-tracking branch 'upstream/master'
rade-popovic May 7, 2018
8204734
Fixed lint errors
rade-popovic May 7, 2018
dff758d
Nano Interactive Bid Adapter
rade-popovic Jun 4, 2018
b3e2607
Fixed documentation
rade-popovic Jun 5, 2018
d0c1330
Removed unnecessary parameter from documentation
rade-popovic Jun 5, 2018
308442b
Cleaning up documentation
rade-popovic Jun 7, 2018
56ba5e0
Resolving conflicts
rade-popovic Jun 7, 2018
4966e59
Merge remote-tracking branch 'upstream/master'
rade-popovic Jul 30, 2018
61161d3
- Sending window location to server if possible
rade-popovic Jul 31, 2018
3ed2508
- Lint errors fix
rade-popovic Jul 31, 2018
39422c9
Using utils.js method for sending location to server
rade-popovic Aug 1, 2018
422f827
Removing unnecessary parameter passing
rade-popovic Aug 1, 2018
471f4e3
Merge branch 'master' of https://github.com/prebid/Prebid.js
rade-popovic Jul 11, 2019
8dddb17
added ConsentString to HB request
rade-popovic Jul 31, 2019
0da72ab
removing unused location params in testing
rade-popovic Aug 6, 2019
87d57b1
Merge branch 'master' into master
rade-popovic Aug 6, 2019
533b17b
changing PID param value for testing
rade-popovic Nov 6, 2019
190d2dd
cookie sync integration
rade-popovic Nov 12, 2019
d6470e1
merge from upstream
rade-popovic Nov 12, 2019
7823934
merge from upstream
rade-popovic Nov 12, 2019
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
27 changes: 24 additions & 3 deletions modules/nanointeractiveBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export const SUB_ID = 'subId';
export const REF = 'ref';
export const LOCATION = 'loc';

var nanoPid = '5a1ec660eb0a191dfa591172';

export const spec = {

code: BIDDER_CODE,
Expand All @@ -29,7 +31,7 @@ export const spec = {
validBidRequests.forEach(
bid => payload.push(createSingleBidRequest(bid, bidderRequest))
);
const url = getEndpointUrl('main') + '/hb';
const url = getEndpointUrl() + '/hb';

return {
method: 'POST',
Expand All @@ -45,13 +47,33 @@ export const spec = {
}
});
return bids;
},
getUserSyncs: function(syncOptions) {
const syncs = [];
if (syncOptions.iframeEnabled) {
syncs.push({
type: 'iframe',
url: getEndpointUrl() + '/hb/cookieSync/' + nanoPid
});
}

if (syncOptions.pixelEnabled) {
syncs.push({
type: 'image',
url: getEndpointUrl() + '/hb/cookieSync/' + nanoPid
});
}
return syncs;
}

};

function createSingleBidRequest(bid, bidderRequest) {
const location = utils.deepAccess(bidderRequest, 'refererInfo.referer');
const origin = utils.getOrigin();

nanoPid = bid.params[SSP_PLACEMENT_ID] || nanoPid;

const data = {
[SSP_PLACEMENT_ID]: bid.params[SSP_PLACEMENT_ID],
[NQ]: [createNqParam(bid)],
Expand Down Expand Up @@ -117,10 +139,9 @@ function isEngineResponseValid(response) {
/**
* Used mainly for debugging
*
* @param type
* @returns string
*/
function getEndpointUrl(type) {
function getEndpointUrl() {
const nanoConfig = config.getConfig('nano');
return (nanoConfig && nanoConfig['endpointUrl']) || END_POINT_URL;
}
Expand Down