Skip to content

Commit 61c0bee

Browse files
jgrimesjsnellbaker
authored andcommitted
InSkin Bid Adapter: add user syncing (#2287)
1 parent 749e3c4 commit 61c0bee

File tree

2 files changed

+31
-5
lines changed

2 files changed

+31
-5
lines changed

modules/inskinBidAdapter.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,27 @@ export const spec = {
151151
},
152152

153153
getUserSyncs: function(syncOptions) {
154-
return [];
154+
const userSyncs = [];
155+
156+
if (syncOptions.pixelEnabled) {
157+
userSyncs.push({
158+
type: 'image',
159+
url: 'https://e.serverbid.com/udb/9969/match?redir=https%3A%2F%2Fmfad.inskinad.com%2Fudb%2F9874%2Fpool%2Fset%2Fi.gif%3FpoolId%3D9969%26poolKey%3D'
160+
});
161+
userSyncs.push({
162+
type: 'image',
163+
url: 'https://ssum.casalemedia.com/usermatchredir?s=185638&cb=https%3A%2F%2Fmfad.inskinad.com%2Fudb%2F9874%2Fsync%2Fi.gif%3FpartnerId%3D1%26userId%3D'
164+
});
165+
}
166+
167+
if (syncOptions.iframeEnabled) {
168+
userSyncs.push({
169+
type: 'iframe',
170+
url: 'https://ssum-sec.casalemedia.com/usermatch?s=184665&cb=https%3A%2F%2Fmfad.inskinad.com%2Fudb%2F9874%2Fsync%2Fi.gif%3FpartnerId%3D1%26userId%3D'
171+
});
172+
}
173+
174+
return userSyncs;
155175
}
156176
};
157177

test/spec/modules/inskinBidAdapter_spec.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,18 +236,24 @@ describe('InSkin BidAdapter', () => {
236236
});
237237
});
238238
describe('getUserSyncs', () => {
239-
let syncOptions = {'iframeEnabled': true};
240-
241239
it('handles empty sync options', () => {
242240
let opts = spec.getUserSyncs({});
243241

244242
expect(opts).to.be.empty;
245243
});
246244

247-
it('should always return empty array', () => {
245+
it('should return two sync urls if pixel syncs are enabled', () => {
246+
let syncOptions = {'pixelEnabled': true};
248247
let opts = spec.getUserSyncs(syncOptions);
249248

250-
expect(opts).to.be.empty;
249+
expect(opts.length).to.equal(2);
250+
});
251+
252+
it('should return three sync urls if pixel and iframe syncs are enabled', () => {
253+
let syncOptions = {'iframeEnabled': true, 'pixelEnabled': true};
254+
let opts = spec.getUserSyncs(syncOptions);
255+
256+
expect(opts.length).to.equal(3);
251257
});
252258
});
253259
});

0 commit comments

Comments
 (0)