-
Notifications
You must be signed in to change notification settings - Fork 696
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
Add Ext.Prebid.Analytics Support #3563
Conversation
analytics/build/build.go
Outdated
// Given analytics adapter module is not present in ext.prebid.analytics, remove the entire analytics object from request for logging | ||
if _, ok := extPrebidAnalytics[adapterName]; !ok { | ||
reqExtPrebid.Analytics = nil | ||
reqExt.SetPrebid(reqExtPrebid) |
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.
At this point, we will be modifying the original request wrapper sent in to LogAuctionObject()
at the top of this file unless evaluateActivities()
found something it needed to change and thus has already cloned the request wrapper. You probably need to record a isCloned
flag and pass it down here, so you can know if you need to clone the request wrapper before modifying the Analytics object.
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.
My latest commits should address this, and I added tests that should've caught this issue initially!
analytics/build/build_test.go
Outdated
} | ||
|
||
func TestLogAnalyticsObjectExtRequestPrebidAnalytics(t *testing.T) { | ||
func (m *secondMockAnalytics) LogVideoObject(vo *analytics.VideoObject) { |
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.
Why do you have two independent struct types rather than one type with two independent instances?
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.
LGTM
Addresses this issue: #1800
The goal of this PR is to add a new object on the request:
bidrequest.ext.prebid.analytics
and pass this object to analytics adapters.The object that will live at this path will be
ExtPrebidAnalytics: {name_of_analytics_adapter: {client-analytics: bool}}
Before the object is made available to the analytics adapters through the various
LogObject
functions inbuild.go
, PBS-Go will loop over the new analytics object on the request, and before logging for a specific analytics adapter, we'll update the request that's being logged to only include the analytics information for that specific adapter.