Skip to content

Nexx360 Analytics Adapter: add analytics adapter - #15388

Open
gchicoye wants to merge 1 commit into
prebid:masterfrom
nexx360:nexx360-analytics-agent
Open

Nexx360 Analytics Adapter: add analytics adapter#15388
gchicoye wants to merge 1 commit into
prebid:masterfrom
nexx360:nexx360-analytics-agent

Conversation

@gchicoye

@gchicoye gchicoye commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Type of change

  • Feature
  • Does this change affect user-facing APIs or examples documented on http://prebid.org? — new analytics adapter; docs PR to prebid.github.io linked below.

Description of change

Adds the Nexx360 Analytics Adapter (nexx360Analytics), an endpoint-type analytics adapter that reports Prebid auction activity to the Nexx360 monitoring collector.

  • Buffered per auction, flushed once on auctionEnd: auctionInit, bidRequested, bidResponse, bidTimeout.
  • Sent immediately: bidWon, adRenderSucceeded, adRenderFailed (failure carries reason).
  • serverAuction event: when a nexx360 bid response is seen, a serverAuction event is synthesized (once per auction) from server-side auction data on the Nexx360 OpenRTB response ext, via libraries/nexx360Utils.
  • Beacons POST a JSON array to ${endpoint}/events (default https://monitoring.nexx360.io) using noCredsAjax with contentType: 'text/plain', so the cross-origin request is a CORS simple request (no preflight) and carries no credentials.
  • Sampling is applied server-side; the adapter exposes no sampling option.

Config (enableAnalytics options): publisherId (required), endpoint (optional), abTestLabel (optional).

Rules compliance: uses the shared AnalyticsAdapter base (provides disableAnalytics); no storage (gvlid: null); TypeScript public types provided.

Also extends libraries/nexx360Utils (already used by the merged Nexx360 Bid Adapter) with extractServerAuction / getLastServerAuctionData / clearLastServerAuctionData plus a types module — a functional dependency of the serverAuction event.

Maintainer: tech@nexx360.io

Testing

  • eslint on changed files — clean.
  • Unit tests — 22 passing (adapter + nexx360Utils server-auction spec).
  • Coverage on added/modified code: adapter ~96.9% lines / 97.0% functions / 94.3% branches; nexx360Utils additions 100%.

Other information

  • Documentation PR: to be linked (prebid.github.io).

Docs PR: prebid/prebid.github.io#6680

@github-actions

Copy link
Copy Markdown

This PR includes an adapter whose code does not match its file name. Bid adapter modules should be named <bidderCode>BidAdapter, userId <userIdCode>IdSystem, RTD <rtdCode>RtdProvider, and analytics <analyticsCode>AnalyticsAdapter.

@github-actions

Copy link
Copy Markdown

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:

  • Changes to modules/nexx360AnalyticsAdapter.ts may need:
    • es.array.push
    • es.iterator.constructor
    • es.iterator.for-each
    • es.iterator.map
    • es.json.stringify
    • es.set.difference.v2
    • es.set.intersection.v2
    • es.set.is-disjoint-from.v2
    • es.set.is-subset-of.v2
    • es.set.is-superset-of.v2
    • es.set.symmetric-difference.v2
    • es.set.union.v2
    • esnext.iterator.constructor
    • esnext.iterator.for-each
    • esnext.iterator.map
    • esnext.set.difference.v2
    • esnext.set.intersection.v2
    • esnext.set.is-disjoint-from.v2
    • esnext.set.is-subset-of.v2
    • esnext.set.is-superset-of.v2
    • esnext.set.symmetric-difference.v2
    • esnext.set.union.v2
  • Changes to test/spec/modules/nexx360AnalyticsAdapter_spec.js may need:
    • es.iterator.constructor
    • es.iterator.filter
    • es.iterator.find
    • es.iterator.for-each
    • es.iterator.map
    • es.iterator.some
    • esnext.iterator.constructor
    • esnext.iterator.filter
    • esnext.iterator.find
    • esnext.iterator.for-each
    • esnext.iterator.map
    • esnext.iterator.some
    • esnext.json.parse

The best way to address this is to provide good test coverage, as normal PR checks run unit tests on older browsers.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread modules/nexx360AnalyticsAdapter.ts Outdated
Comment on lines +356 to +357
function formatSizes(sizes?: [number, number][]): string[] {
return (sizes || []).map(s => `${s[0]}x${s[1]}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +223 to +224
if (serverAuction && typeof serverAuction === 'object' && serverAuction.auctionId) {
lastServerAuctionData = serverAuction as Nexx360ServerAuction;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

barecheck Bot commented Jul 24, 2026

Copy link
Copy Markdown

Barecheck - Code coverage report

Total: 96.59%

Your code coverage diff: 0.00% ▴

Uncovered files and lines
FileLines
libraries/nexx360Utils/index.ts83-84, 112-113, 205
modules/nexx360AnalyticsAdapter.ts631, 659, 665, 674

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
@gchicoye
gchicoye force-pushed the nexx360-analytics-agent branch from b12c995 to 59f6343 Compare July 25, 2026 06:15
@gchicoye

gchicoye commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Hi @monis0395, @jsnellbaker , any news on that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant