Skip to content

Commit

Permalink
adxcgAnalyticsAdapter.js prebid 3.0 requirements compatibility (#4515)
Browse files Browse the repository at this point in the history
* adxcgAnalyticsAdapter.js prebid 3.0 requirements compatibility

* CI restart

* CI restart

* Updated docs
  • Loading branch information
adxcgcom authored and jsnellbaker committed Dec 4, 2019
1 parent 32aef56 commit aba3689
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
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 [email protected]
* 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

0 comments on commit aba3689

Please sign in to comment.