-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Nexx360 Analytics Adapter: add analytics adapter #15388
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
Open
gchicoye
wants to merge
1
commit into
prebid:master
Choose a base branch
from
nexx360:nexx360-analytics-agent
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| /** Per-SSP bid attempt for a specific impression */ | ||
| export interface Nexx360SSPBid { | ||
| ssp: string; | ||
| status: 'bid' | 'noBid' | 'timeout' | 'error'; | ||
| responseTimeMs?: number; | ||
| cpm?: number; | ||
| currency?: string; | ||
| size?: string; | ||
| dealId?: string; | ||
| bidId?: string; | ||
| error?: string; | ||
| } | ||
|
|
||
| /** Auction summary for a single impression */ | ||
| export interface Nexx360ImpressionAuction { | ||
| impId: string; | ||
| adUnitCode: string; | ||
| bids: Nexx360SSPBid[]; | ||
| totalSsps: number; | ||
| bidsReceived: number; | ||
| timeouts: number; | ||
| errors: number; | ||
| auctionTimeMs: number; | ||
| winner?: { | ||
| ssp: string; | ||
| cpm: number; | ||
| currency: string; | ||
| }; | ||
| } | ||
|
|
||
| /** Server-side auction data attached to Nexx360 OpenRTB response ext */ | ||
| export interface Nexx360ServerAuction { | ||
| auctionId: string; | ||
| timestamp: number; | ||
| impressions: Nexx360ImpressionAuction[]; | ||
| totalImpressions: number; | ||
| totalSspsCalled: number; | ||
| totalBidsReceived: number; | ||
| totalTimeouts: number; | ||
| totalErrors: number; | ||
| auctionTimeMs: number; | ||
| } | ||
|
|
||
| /** Top-level Nexx360 response extension */ | ||
| export interface Nexx360ResponseExt { | ||
| cookies?: unknown[]; | ||
| serverAuction?: Nexx360ServerAuction; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "NOTICE": "do not edit - this file is autogenerated by `gulp update-metadata`", | ||
| "disclosures": {}, | ||
| "purposes": {}, | ||
| "components": [ | ||
| { | ||
| "componentType": "analytics", | ||
| "componentName": "nexx360", | ||
| "gvlid": null | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| # Overview | ||
|
|
||
| Module Name: Nexx360 Analytics Adapter | ||
| Module Type: Analytics Adapter | ||
| Maintainer: tech@nexx360.io | ||
|
|
||
| # Description | ||
|
|
||
| The Nexx360 Analytics Adapter collects Prebid.js auction data and sends it to the Nexx360 analytics platform for monitoring and reporting. It tracks auction lifecycle events, bid requests, bid responses, wins, timeouts, and ad render events. | ||
|
|
||
| # Registration | ||
|
|
||
| The Nexx360 Analytics adapter requires a publisher ID from Nexx360. Please contact Nexx360 to obtain your publisher credentials. | ||
|
|
||
| ```javascript | ||
| pbjs.enableAnalytics({ | ||
| provider: 'nexx360', | ||
| options: { | ||
| publisherId: 'your-publisher-id', | ||
| endpoint: 'https://monitoring.nexx360.io' | ||
| } | ||
| }); | ||
| ``` | ||
|
|
||
| Sampling is applied server-side (by the Nexx360 collector), so the adapter sends | ||
| all events and exposes no sampling option. | ||
|
|
||
| # Analytics Options | ||
|
|
||
| {: .table .table-bordered .table-striped } | ||
| | Name | Scope | Description | Example | Type | | ||
| |------|-------|-------------|---------|------| | ||
| | publisherId | required | Your Nexx360 publisher identifier | `"pub-12345"` | string | | ||
| | endpoint | optional | Analytics endpoint URL (defaults to `https://monitoring.nexx360.io`) | `"https://monitoring.nexx360.io"` | string | | ||
| | abTestLabel | optional | A/B test variant label, attached to every event for slicing analytics by test arm | `"variantA"` | string | | ||
|
|
||
| # Events Tracked | ||
|
|
||
| The adapter tracks the following Prebid.js events: | ||
|
|
||
| - **auctionInit** - When an auction starts | ||
| - **bidRequested** - When bid requests are sent to bidders | ||
| - **bidResponse** - When bid responses are received | ||
| - **bidWon** - When a bid wins the auction | ||
| - **bidTimeout** - When bidders timeout | ||
| - **adRenderSucceeded** - When an ad renders successfully | ||
| - **adRenderFailed** - When an ad fails to render | ||
|
|
||
| # Example Configuration | ||
|
|
||
| ## Basic Setup | ||
|
|
||
| ```javascript | ||
| pbjs.enableAnalytics({ | ||
| provider: 'nexx360', | ||
| options: { | ||
| publisherId: 'your-publisher-id' | ||
| } | ||
| }); | ||
| ``` | ||
|
|
||
| ## Production Setup | ||
|
|
||
| ```javascript | ||
| pbjs.enableAnalytics({ | ||
| provider: 'nexx360', | ||
| options: { | ||
| publisherId: 'your-publisher-id', | ||
| endpoint: 'https://monitoring.nexx360.io' | ||
| } | ||
| }); | ||
| ``` | ||
|
|
||
| # Build | ||
|
|
||
| To include this analytics adapter in your Prebid.js build: | ||
|
|
||
| ```bash | ||
| gulp build --modules=nexx360AnalyticsAdapter,... | ||
| ``` |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a Nexx360 response includes
ext.serverAuctionbut produces no accepted bid response, for example an emptyseatbidresponse, 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 59f6343.
interpretResponsenow clears any stored server-auction data when a response produces no bid responses (emptyseatbid), and only storesext.serverAuctionwhen the response actually yields bids that abidResponsewill 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.