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

adxcgAnalyticsAdapter.js prebid 3.0 requirements compatibility #4515

Merged
merged 4 commits into from
Dec 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 8 additions & 6 deletions modules/adxcgAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import CONSTANTS from '../src/constants.json';
import * as url from '../src/url';
import * as utils from '../src/utils';

/**
* Analytics adapter from adxcg.com
* maintainer info@adxcg.com
* updated 201911 for prebid 3.0
*/

const emptyUrl = '';
const analyticsType = 'endpoint';
const adxcgAnalyticsVersion = 'v2.01';
Expand Down Expand Up @@ -107,11 +113,8 @@ function mapBidWon (bidResponse) {
}

function send (data) {
let location = utils.getTopWindowLocation();
let secure = location.protocol === 'https:';

let adxcgAnalyticsRequestUrl = url.format({
protocol: secure ? 'https' : 'http',
protocol: 'https',
hostname: adxcgAnalyticsAdapter.context.host,
pathname: '/pbrx/v2',
search: {
Expand Down Expand Up @@ -145,14 +148,13 @@ adxcgAnalyticsAdapter.enableAnalytics = function (config) {
return;
}

let secure = location.protocol === 'https:';
adxcgAnalyticsAdapter.context = {
events: {
bidRequests: [],
bidResponses: []
},
initOptions: config.options,
host: config.options.host || (secure ? 'hbarxs.adxcg.net' : 'hbarx.adxcg.net')
host: config.options.host || ('hbarxs.adxcg.net')
};

adxcgAnalyticsAdapter.originEnableAnalytics(config);
Expand Down
2 changes: 1 addition & 1 deletion modules/adxcgAnalyticsAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ https://www.adxcg.com/
{
provider: 'adxcg',
options : {
publisherId: ["42"]
publisherId: "42"
}
}

Expand Down