Skip to content

Commit

Permalink
Merged in yhhuang@add-prediction-id-support (pull request prebid#29)
Browse files Browse the repository at this point in the history
add prediction id support.

Approved-by: Jen-Yee Hong <pcman.hong@appier.com>
  • Loading branch information
yhhuang-appier committed Apr 12, 2019
2 parents eed3071 + 62822d9 commit da2f6e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions modules/appierAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {logError, logInfo} from '../src/utils';
const utils = require('../src/utils');
const analyticsType = 'endpoint';

export const ANALYTICS_VERSION = '0.2.1-beta';
export const ANALYTICS_VERSION = '0.2.2-beta';

const DEFAULT_SERVER = 'https://prebid-analytics.c.appier.net/v1';

Expand Down Expand Up @@ -58,6 +58,7 @@ export const appierAnalyticsAdapter = Object.assign(adapter({DEFAULT_SERVER, ana
* Optional option: sampling
* Optional option: adSampling
* Optional option: autoPick
* Optional option: predictionId
* @type {boolean}
*/
analyticsOptions.options = utils.deepClone(config.options);
Expand All @@ -83,6 +84,7 @@ export const appierAnalyticsAdapter = Object.assign(adapter({DEFAULT_SERVER, ana
analyticsOptions.adSampled = Math.random() < parseFloat(config.options.adSampling);
}
analyticsOptions.autoPick = config.options.autoPick || null;
analyticsOptions.predictionId = config.options.predictionId || null;

return true;
},
Expand All @@ -104,7 +106,8 @@ export const appierAnalyticsAdapter = Object.assign(adapter({DEFAULT_SERVER, ana
sampling: analyticsOptions.options.sampling,
adSampling: analyticsOptions.options.adSampling,
prebid: '$prebid.version$',
autoPick: analyticsOptions.options.autoPick,
autoPick: analyticsOptions.autoPick,
predictionId: analyticsOptions.predictionId,
adUnits: {},
};
},
Expand Down
4 changes: 3 additions & 1 deletion test/spec/modules/appierAnalyticsAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import * as ajax from 'src/ajax';
const events = require('src/events');

const affiliateId = 'WhctHaViHtI';
const configId = 'd9cc9a9b-e9b2-40ed-a17c-f1c9a8a4b29c';
const configId = 'd9cc9a9be9b240eda17cf1c9a8a4b29c';
const serverUrl = 'https://analytics.server.url/v1';
const autoPick = 'none';
const predictionId = '2a91ca5de54a4a2e89950af439f7a27f';
const auctionId = 'b0b39610-b941-4659-a87c-de9f62d3e13e';

describe('Appier Prebid AnalyticsAdapter', function () {
Expand All @@ -22,6 +23,7 @@ describe('Appier Prebid AnalyticsAdapter', function () {
configId: configId,
server: serverUrl,
autoPick: autoPick,
predictionId: predictionId,
sampling: 0,
adSampling: 1,
};
Expand Down

0 comments on commit da2f6e3

Please sign in to comment.