Skip to content
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

Browsi RTD Module: add pageview billable event #9207

Merged
merged 72 commits into from
Nov 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
6121b4e
real time data module,
omerDotan Aug 25, 2019
1a80b14
change timeout&primary ad server only to auctionDelay
omerDotan Sep 9, 2019
3b85815
support multiple providers
omerDotan Sep 18, 2019
0cb7b69
change promise to callbacks
omerDotan Oct 16, 2019
0908134
bug fixes
omerDotan Nov 3, 2019
cf4c5a9
use Prebid ajax
omerDotan Nov 6, 2019
7beeee3
tests fix
omerDotan Nov 6, 2019
60aaeaa
browsi real time data provider improvements
omerDotan Dec 8, 2019
0e06e6f
real time data module,
omerDotan Aug 25, 2019
e9312c7
change timeout&primary ad server only to auctionDelay
omerDotan Sep 9, 2019
c0901fe
support multiple providers
omerDotan Sep 18, 2019
398f922
change promise to callbacks
omerDotan Oct 16, 2019
b3d0bea
bug fixes
omerDotan Nov 3, 2019
a4f2de6
use Prebid ajax
omerDotan Nov 6, 2019
65ed991
tests fix
omerDotan Nov 6, 2019
15337d2
browsi real time data provider improvements
omerDotan Dec 8, 2019
76b3208
Merge remote-tracking branch 'origin/master'
omerDotan Dec 12, 2019
6a8c111
Merge remote-tracking branch 'upstream/master'
omerDotan Jan 16, 2020
b9b05f0
Merge remote-tracking branch 'upstream/master'
omerDotan Jan 20, 2020
89013d7
Merge remote-tracking branch 'upstream/master'
omerDotan Jan 21, 2020
342484c
Merge remote-tracking branch 'upstream/master'
omerDotan Jan 22, 2020
faa02bf
Merge remote-tracking branch 'upstream/master'
omerDotan Jan 28, 2020
88430b1
Merge remote-tracking branch 'upstream/master'
omerDotan Feb 11, 2020
b73b6d7
Merge remote-tracking branch 'upstream/master'
omerDotan Feb 23, 2020
00c027c
Merge remote-tracking branch 'upstream/master'
omerDotan Apr 2, 2020
51555b6
Merge remote-tracking branch 'upstream/master'
omerDotan Apr 7, 2020
c959997
Merge remote-tracking branch 'upstream/master'
omerDotan Apr 21, 2020
a277d65
Merge remote-tracking branch 'upstream/master'
omerDotan May 4, 2020
ebf1fa8
Merge remote-tracking branch 'upstream/master'
omerDotan May 25, 2020
6ec752e
Merge remote-tracking branch 'upstream/master'
omerDotan May 28, 2020
6af3494
Merge remote-tracking branch 'upstream/master'
omerDotan Jul 13, 2020
f0d9bb7
Merge remote-tracking branch 'upstream/master'
omerDotan Jul 20, 2020
608eabf
Merge remote-tracking branch 'upstream/master'
omerDotan Jul 21, 2020
6bdd935
Merge remote-tracking branch 'upstream/master'
omerDotan Jul 26, 2020
ca43a02
Merge remote-tracking branch 'upstream/master'
omerDotan Aug 10, 2020
8346da4
Merge remote-tracking branch 'upstream/master'
omerDotan Aug 23, 2020
1f5a82e
Merge remote-tracking branch 'upstream/master'
omerDotan Aug 27, 2020
1c0d024
Merge remote-tracking branch 'upstream/master'
omerDotan Sep 14, 2020
6c7cac7
Merge remote-tracking branch 'upstream/master'
omerDotan Sep 21, 2020
1543516
Merge remote-tracking branch 'upstream/master'
omerDotan Sep 23, 2020
efe5ddf
Merge remote-tracking branch 'upstream/master'
omerDotan Oct 4, 2020
b404b69
Merge remote-tracking branch 'upstream/master'
omerDotan Nov 2, 2020
107f00c
Merge remote-tracking branch 'upstream/master'
omerDotan Nov 25, 2020
cea0004
Merge remote-tracking branch 'upstream/master'
omerDotan May 18, 2021
2dcd7af
Merge remote-tracking branch 'upstream/master'
omerDotan Jun 6, 2021
86d4cf7
Merge remote-tracking branch 'upstream/master'
omerDotan Jul 5, 2021
191056f
Merge remote-tracking branch 'upstream/master'
omerDotan Jul 29, 2021
97c94b2
Merge remote-tracking branch 'upstream/master'
omerDotan Aug 8, 2021
ede3d7f
Merge remote-tracking branch 'upstream/master'
omerDotan Aug 10, 2021
e435be5
Merge remote-tracking branch 'upstream/master'
omerDotan Oct 11, 2021
6a2293e
Merge remote-tracking branch 'upstream/master'
omerDotan Oct 17, 2021
f918fb8
Merge remote-tracking branch 'upstream/master'
omerDotan Nov 21, 2021
60d8c5c
Merge remote-tracking branch 'upstream/master'
omerDotan Dec 22, 2021
a1f37fd
Merge remote-tracking branch 'upstream/master'
omerDotan Jan 12, 2022
6dd4ea3
Merge remote-tracking branch 'upstream/master'
omerDotan Feb 1, 2022
66e782e
Merge remote-tracking branch 'upstream/master'
omerDotan Feb 3, 2022
2f16e37
Merge remote-tracking branch 'upstream/master'
omerDotan Feb 9, 2022
1c577d8
Merge remote-tracking branch 'upstream/master'
omerDotan Feb 16, 2022
a52ac36
Merge remote-tracking branch 'upstream/master'
omerDotan Feb 20, 2022
3505c14
Merge remote-tracking branch 'upstream/master'
omerDotan Mar 13, 2022
1a6da04
Merge remote-tracking branch 'upstream/master'
omerDotan Apr 11, 2022
d5f83b5
Merge remote-tracking branch 'upstream/master'
omerDotan Jul 12, 2022
02c5eae
Merge remote-tracking branch 'upstream/master'
omerDotan Aug 2, 2022
3fca8ef
Merge remote-tracking branch 'upstream/master'
omerDotan Aug 14, 2022
5ccd7db
Merge remote-tracking branch 'upstream/master'
omerDotan Aug 31, 2022
9684d53
Merge remote-tracking branch 'upstream/master'
omerDotan Sep 15, 2022
0f7ff71
Merge remote-tracking branch 'upstream/master'
omerDotan Sep 20, 2022
42eae36
Merge remote-tracking branch 'upstream/master'
omerDotan Sep 29, 2022
074a392
Merge remote-tracking branch 'upstream/master'
omerDotan Oct 23, 2022
ee3a43c
Merge remote-tracking branch 'upstream/master'
omerDotan Oct 26, 2022
f58a3f6
Merge remote-tracking branch 'upstream/master'
omerDotan Nov 6, 2022
ffed007
fire billable event according to event listener
omerDotan Nov 6, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions modules/browsiRtdProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@ export function addBrowsiTag(data) {

export function sendPageviewEvent(eventType) {
if (eventType === 'PAGEVIEW') {
events.emit(CONSTANTS.EVENTS.BILLABLE_EVENT, {
vendor: 'browsi',
type: 'pageview',
billingId: generateUUID()
window.addEventListener('browsi_pageview', () => {
events.emit(CONSTANTS.EVENTS.BILLABLE_EVENT, {
vendor: 'browsi',
type: 'pageview',
billingId: generateUUID()
})
Copy link
Collaborator

Choose a reason for hiding this comment

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

so every time a call to browsi endpoint is called getPredictionsFromServer it will add this event listener again.

So possible this means it can add several listeners in a given page load and then emit a billing event for each time it added.

I think a flag here to ensure this event listener is only set once is the right thing to do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can add a flag if you think we need extra validation. but getPredictionsFromServer is only called once per instance

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok did not know that.

What if multiple prebid instances with browsi are added to a page?

Such as an iframe setup where each wrapper is in its own iframe. Do we want to have each instance add an event listener?

Probably fine I just wanted to double check.

Sounds like this will add an event listener any time a wrapper is loaded. Which probably is the right idea?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a very rare case (not only do we need to have a few instances on the page, we need them to use the Browsi RTD provider), but if it happens there should be a pageview event per wrapper.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@robertrmartinez is there anything you need from me to approve the PR?

})
}
}
Expand Down
3 changes: 2 additions & 1 deletion test/spec/modules/browsiRtdProvider_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ describe('browsi Real time data sub module', function () {
})
it('should send event if type is correct', function () {
sendPageviewEvent('PAGEVIEW')

const pageViewEvent = new CustomEvent('browsi_pageview', {});
window.dispatchEvent(pageViewEvent);
const expectedCall = {
vendor: 'browsi',
type: 'pageview',
Expand Down