Skip to content

Commit

Permalink
Merge pull request #160 from guardian/ei/add-requests-to-hb-back
Browse files Browse the repository at this point in the history
Restart sending requests to the commercial/api/hb endpoint
  • Loading branch information
emma-imber authored Oct 14, 2024
2 parents 03e0190 + fe28441 commit 196048b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
10 changes: 10 additions & 0 deletions modules/guAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,16 @@ function logEvents(events) {
log('commercial', `Prebid.js events: ${logMsg}`, events);
}

analyticsAdapter.ajaxCall = function ajaxCall(data) {
const url = `${analyticsAdapter.context.ajaxUrl}/commercial/api/hb`;
const callback = (data) => logEvents(JSON.parse(data).hb_ev);
const options = {
method: 'POST',
contentType: 'text/plain; charset=utf-8'
};
ajax(url, callback(data), data, options);
};

function trackBidWon(args) {
const event = {ev: 'bidwon'};
setSafely(event, 'aid', args.auctionId);
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@guardian/prebid.js",
"version": "8.52.0-6",
"version": "8.52.0-7",
"description": "Header Bidding Management Library",
"main": "src/prebid.js",
"files": [
Expand Down Expand Up @@ -145,4 +145,4 @@
"optionalDependencies": {
"fsevents": "^2.3.2"
}
}
}

0 comments on commit 196048b

Please sign in to comment.