Nexx360 Analytics Adapter: add analytics adapter - #15388
Conversation
|
This PR includes an adapter whose code does not match its file name. Bid adapter modules should be named |
|
This PR introduces changes that may not work on all browsers. According to Babel, the following polyfills may be needed, and they are not automatically included:
The best way to address this is to provide good test coverage, as normal PR checks run unit tests on older browsers. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b12c995d02
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| function formatSizes(sizes?: [number, number][]): string[] { | ||
| return (sizes || []).map(s => `${s[0]}x${s[1]}`); |
There was a problem hiding this comment.
Normalize single-size arrays before mapping
When an ad unit uses Prebid's supported single-size form such as sizes: [300, 250], this maps each number as though it were a [w, h] tuple, producing ['undefinedxundefined', 'undefinedxundefined'] for BID_REQUESTED/BID_TIMEOUT payloads. That corrupts size analytics for single-size ad units; normalize both Size and Size[] shapes before formatting.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Good catch — fixed in 59f6343. formatSizes now normalizes Prebid's single-size flat form ([300, 250]) in addition to [[300, 250]], so a single-size ad unit yields ['300x250'] instead of ['undefinedxundefined']. Added a unit test covering the flat form.
| if (serverAuction && typeof serverAuction === 'object' && serverAuction.auctionId) { | ||
| lastServerAuctionData = serverAuction as Nexx360ServerAuction; |
There was a problem hiding this comment.
Scope server auction data to the producing response
When a Nexx360 response includes ext.serverAuction but produces no accepted bid response, for example an empty seatbid response, this stores the server auction in a single module-level slot and no BID_RESPONSE path runs to clear it. The next unrelated Nexx360 bid response can then emit that stale serverAuction under the wrong client auction, so this data needs to be keyed to the response/request or cleared when no bid responses are produced.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 59f6343. interpretResponse now clears any stored server-auction data when a response produces no bid responses (empty seatbid), and only stores ext.serverAuction when the response actually yields bids that a bidResponse will consume. A stale value can therefore no longer leak into a later, unrelated auction. Added tests for both the store-then-consume and clear-on-no-bids paths.
Barecheck - Code coverage reportTotal: 96.59%Your code coverage diff: 0.00% ▴ Uncovered files and lines
|
Adds the nexx360 endpoint analytics adapter. It buffers per-auction events (auctionInit, bidRequested, bidResponse, bidTimeout) and flushes them on auctionEnd, and sends bidWon / adRenderSucceeded / adRenderFailed immediately. When a nexx360 bid response arrives, a serverAuction event is synthesized from server-side auction data on the OpenRTB response ext. Beacons POST as text/plain (no CORS preflight) with no credentials. Sampling is applied server-side. Also extends libraries/nexx360Utils (used by the Nexx360 Bid Adapter) with extractServerAuction / getLastServerAuctionData / clearLastServerAuctionData plus a types module, which the serverAuction event depends on. Maintainer: tech@nexx360.io Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NGAcCirXcABf5miqJbouV2
b12c995 to
59f6343
Compare
|
Hi @monis0395, @jsnellbaker , any news on that? |
Type of change
Description of change
Adds the Nexx360 Analytics Adapter (
nexx360Analytics), anendpoint-type analytics adapter that reports Prebid auction activity to the Nexx360 monitoring collector.auctionEnd:auctionInit,bidRequested,bidResponse,bidTimeout.bidWon,adRenderSucceeded,adRenderFailed(failure carriesreason).serverAuctionevent: when anexx360bid response is seen, aserverAuctionevent is synthesized (once per auction) from server-side auction data on the Nexx360 OpenRTB responseext, vialibraries/nexx360Utils.${endpoint}/events(defaulthttps://monitoring.nexx360.io) usingnoCredsAjaxwithcontentType: 'text/plain', so the cross-origin request is a CORS simple request (no preflight) and carries no credentials.Config (
enableAnalyticsoptions):publisherId(required),endpoint(optional),abTestLabel(optional).Rules compliance: uses the shared
AnalyticsAdapterbase (providesdisableAnalytics); no storage (gvlid: null); TypeScript public types provided.Also extends
libraries/nexx360Utils(already used by the merged Nexx360 Bid Adapter) withextractServerAuction/getLastServerAuctionData/clearLastServerAuctionDataplus atypesmodule — a functional dependency of theserverAuctionevent.Maintainer: tech@nexx360.io
Testing
Other information
Docs PR: prebid/prebid.github.io#6680