File tree Expand file tree Collapse file tree 3 files changed +41
-2
lines changed Expand file tree Collapse file tree 3 files changed +41
-2
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ analytics:
12
12
# Required: set the accounts you want to track
13
13
accounts :
14
14
- code : " my-code" # Required: provied by agma
15
- publisher_id : " 123" # Required: Exchange specific publisher_id
16
- site_app_id : " openrtb2-site.id-or-app.id" # optional: scope to the publisher with an openrtb2 Site object id or App object id
15
+ publisher_id : " 123" # Required: Exchange specific publisher_id, can be an empty string accounts are not used
16
+ site_app_id : " openrtb2-site.id-or-app.id-or-app.bundle " # optional: scope to the publisher with an openrtb2 Site object id or App object id/bundle
17
17
# Optional properties (advanced configuration)
18
18
endpoint :
19
19
url : " https://go.pbs.agma-analytics.de/v1/prebid-server" # Check with agma if your site needs an extra url
Original file line number Diff line number Diff line change @@ -169,6 +169,10 @@ func (l *AgmaLogger) extractPublisherAndSite(requestWrapper *openrtb_ext.Request
169
169
publisherId = requestWrapper .App .Publisher .ID
170
170
}
171
171
appSiteId = requestWrapper .App .ID
172
+ if appSiteId == "" {
173
+ appSiteId = requestWrapper .App .Bundle
174
+ }
175
+
172
176
}
173
177
return publisherId , appSiteId
174
178
}
Original file line number Diff line number Diff line change @@ -188,6 +188,11 @@ func TestShouldTrackEvent(t *testing.T) {
188
188
PublisherId : "track-me" ,
189
189
Code : "abc" ,
190
190
},
191
+ {
192
+ PublisherId : "" ,
193
+ SiteAppId : "track-me" ,
194
+ Code : "abc" ,
195
+ },
191
196
},
192
197
}
193
198
mockedSender := new (MockedSender )
@@ -283,6 +288,36 @@ func TestShouldTrackEvent(t *testing.T) {
283
288
284
289
assert .False (t , shouldTrack )
285
290
assert .Equal (t , "" , code )
291
+
292
+ // should allow empty accounts
293
+ shouldTrack , code = logger .shouldTrackEvent (& openrtb_ext.RequestWrapper {
294
+ BidRequest : & openrtb2.BidRequest {
295
+ App : & openrtb2.App {
296
+ ID : "track-me" ,
297
+ },
298
+ User : & openrtb2.User {
299
+ Ext : json .RawMessage (`{"consent": "` + agmaConsent + `"}` ),
300
+ },
301
+ },
302
+ })
303
+
304
+ assert .True (t , shouldTrack )
305
+ assert .Equal (t , "abc" , code )
306
+
307
+ // Bundle ID instead of app.id
308
+ shouldTrack , code = logger .shouldTrackEvent (& openrtb_ext.RequestWrapper {
309
+ BidRequest : & openrtb2.BidRequest {
310
+ App : & openrtb2.App {
311
+ Bundle : "track-me" ,
312
+ },
313
+ User : & openrtb2.User {
314
+ Ext : json .RawMessage (`{"consent": "` + agmaConsent + `"}` ),
315
+ },
316
+ },
317
+ })
318
+
319
+ assert .True (t , shouldTrack )
320
+ assert .Equal (t , "abc" , code )
286
321
}
287
322
288
323
func TestShouldTrackMultipleAccounts (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments