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

Round-robin Brave Ads campaign advertisers to reduce the frequency of showing the same ad #7888

Closed
tmancey opened this issue Jan 23, 2020 · 2 comments · Fixed by brave/brave-core#4459

Comments

@tmancey
Copy link
Contributor

tmancey commented Jan 23, 2020

We currently round-robin Brave Ads based upon creatives (using the catalogs creativeInstanceId node).

To reduce the frequency of showing the same ad we should round-robin Brave Ads based upon both the advertiser (using the catalogs advertiserId node) and the creatives (based upon the creativeInstanceId).

Use cases:

  • As a user, I do not want to see duplicate ads from a catalog creative until all eligible ads have been shown (already implemented, but here for clarity)
  • As a user, I do not want to see duplicate advertisers from a catalog campaign until all eligible advertisers have been shown
@tmancey tmancey added enhancement priority/P3 The next thing for us to work on. It'll ride the trains. feature/ads labels Jan 23, 2020
@tmancey tmancey added the QA/Yes label Jan 23, 2020
@tmancey tmancey self-assigned this Jan 24, 2020
@tmancey tmancey changed the title Brave Ads should round-robin campaign advertisers to reduce the frequency of showing the same ad Round-robin Brave Ads campaign advertisers to reduce the frequency of showing the same ad Jan 27, 2020
@tmancey tmancey added this to the 1.6.x - Nightly milestone Feb 6, 2020
@bbondy bbondy modified the milestones: 1.6.x - Beta, 1.7.x - Dev Mar 10, 2020
@btlechowski
Copy link

btlechowski commented Apr 8, 2020

Test plan

General test case:

  1. Overwrite the catalog with Charles
  2. Run Brave with command line: /usr/bin/brave-browser --enable-logging=stderr --vmodule=brave_ads=3 --brave-ads-staging --rewards=staging=true
  3. Enable Rewards
  4. Open cars.com
  5. Trigger ad -> This is Ad1.
  6. Wait an hour
  7. Trigger ad -> This is Ad2.
  8. Wait an hour
  9. Trigger ad -> This is Ad3.
  10. Wait an hour
  11. Repeat 2x steps 5-10

Expected result
Duplicate Ad is not shown till all other ads are shown.

Example of expected behavior:
Ad1
Ad2
Ad3

Ad3
Ad2
Ad1

Ad2
Ad1
Ad3

Example of broken behavior:
Ad1
Ad2
Ad3

Ad1
Ad1 - same ad shown twice
Ad3

Ad2
Ad3
Ad2 - same ad shown twice

Test case 1: Ads in the same child category

  1. Go through General test case using catalog: advertisers - same child category.txt

Test case 2: Ads in the same parent category

  1. Go through General test case using catalog: advertisers - same parent category.txt

Test case 3: Ads in different categories (child, parent, untargeted) - triggered every 1 hour

  1. Go through General test case using catalog: advertisers - different categories.txt

Expected behavior:
Only Ad with child category is shown
Ad AAA
Ad AAA
Ad AAA

Test case 4: Ads in different categories (child, parent, untargeted) - triggered every 20 minutes

  1. Overwrite the catalog with Charles advertisers - different categories.txt
  2. Run Brave with command line: /usr/bin/brave-browser --enable-logging=stderr --vmodule=brave_ads=3 --brave-ads-staging --rewards=staging=true
  3. Enable Rewards
  4. Change Ads frequency to 5 per hour
  5. Open cars.com
  6. Trigger ad
  7. Wait 20 minutes
  8. Trigger ad
  9. Wait 20 minutes
  10. Trigger ad
  11. Wait 20 minutes
  12. Repeat 2x steps 6-11

Expected behavior:
The ads are not random, but are shown in order:
Ad AAA
Ad BBB
Ad CCC

@btlechowski
Copy link

btlechowski commented Apr 8, 2020

Verification passed on

Brave 1.7.86 Chromium: 80.0.3987.163 (Official Build) (64-bit)
Revision e7fbe071abe9328cdce4ffedac9822435fbd3656-refs/branch-heads/3987@{#1037}
OS Ubuntu 18.04 LTS

Verified test plan from #7888 (comment)

Verified Test case 1
Screenshot of 6 first ads
image

Ad AAA
Ad CCC
Ad BBB

Ad AAA
Ad BBB
Ad CCC

Ad BBB
Ad AAA
Ad CCC

Verified Test case 2
Screenshot of 6 first ads
image

Ad BBB
Ad CCC
Ad AAA

Ad CCC
Ad BBB
Ad AAA

Ad CCC
Ad AAA
Ad BBB

Verified Test case 3
Screenshot of 6 first ads
image

Failed Test case 4
image

Encountered #8971

Hour 1
Ad AAA
Ad BBB
Ad CCC

Hour 2 - fail, AD BBB not shown
Ad AAA
Ad CCC

Hour 3 - fail, AD BBB not shown
Ad AAA
Ad CCC


Verified passed with

Brave 1.7.86 Chromium: 80.0.3987.163 (Official Build) (64-bit)
Revision e7fbe071abe9328cdce4ffedac9822435fbd3656-refs/branch-heads/3987@{#1037}
OS macOS Version 10.14.6 (Build 18G3020)

AAA (Ad 1)
CCC (Ad 2)
BBB (Ad 3)

CCC
BBB
AAA

AAA
BBB
CCC

7888 - TC1

  • Test Case 2 - PASSED - Ads in same parent category

BBB (Ad 1)
AAA (Ad 2)
CCC (Ad 3)

CCC
BBB
AAA

AAA
CCC
BBB

7888 - TC2

  • Test Case 3 - PASSED - Ads in different categories (1 hr)

Each ad shown was AAA as expected per the test plan

7888 - TC3

  • Test Case 4 FAIL - Ads in different categories (20 min)

Failed due to known issue #8971

AAA (Ad 1)
BBB (Ad 2)
CCC (Ad 3)

AAA
--> Ad BBB could not be shown per logs
CCC

AAA
--> Ad BBB could not be shown per logs
CCC

7888 - TC4

Verification passed on

Brave 1.7.90 Chromium: 80.0.3987.163 (Official Build) (64-bit)
Revision e7fbe071abe9328cdce4ffedac9822435fbd3656-refs/branch-heads/3987@{#1037}
OS Windows 10 OS Version 1803 (Build 17134.1006)

Test Case 1 - FAILED Different advertised ID and creative sets

Parent and child segment with diff advertiser ID and creative sets.txt

  1. Child segment has AD1 and AD2 in catalog
  2. Parent segment has AD1 and AD2 in catalog
  3. Untargeted segment has AD in catalog
  • Verified that all ads from all the 3 segments are shown once in 1st cycle of Round Robin
    Screenshot1 - RR Cycle 1:
    image
    Ads shown in the 1st cycle of RR order is as below:
    AD2 from parent
    AD2 from child
    AD1 from parent
    AD1 from child
    AD from untargeted

  • Verified that all ads from all the 3 segments are shown once in 2nd cycle of Round Robin
    Screenshot2 - RR Cycle 2:
    image

    **Ads shown in the 2nd cycle of RR order is as below:
    AD2 from parent
    AD2 from child
    AD1 from parent
    AD1 from child
    ---AD from untargeted ( This AD did not show due to [Desktop] Round robin - ad with only parent category is shown once #8971 - Ads are not shown from some
    segments in RR cycle2)
    AD2 from parent ( this AD has shown twice)

  • Verified that all ads from all the 3 segments are shown once in 3rd cycle of Round Robin
    Screenshot2 - RR Cycle 3:
    image
    **Ads shown in the 3rd cycle of RR order is as below:
    AD2 from child
    AD1 from parent
    AD from untargeted
    AD1 from child
    AD2 from parent

  • Complete list of ads for 3 cycles of RR ( in 2nd cycle ad isn't shown from untargeted segment [Desktop] Round robin - ad with only parent category is shown once #8971 )
    image

Test Case 2 - PASSED Same child category
Used the catalog file from the above test plan - #7888 (comment)

  • Verified that all ads are shown once in 1st and 2nd cycle of Round Robin

Ads received in the 1st cycle of RR are as below:
image

1st cycle :
AD AAA
AD CCC
AD BBB
Ads received in the 1st cycle of RR are as below:
image

2nd cycle :
AD CCC
AD BBB
AD AAA

Test Case 3 - PASSED Same parent category
Used the catalog file from the above test plan - #7888 (comment)

  • Verified that all ads are shown once in 1st and 2nd cycle of Round Robin

Ads received in the 1st cycle of RR are as below:
image

1st cycle:
AD AAA
AD CCC
AD BBB
Ads received in the 2nd cycle of RR are as below:
image

2nd cycle:
AD BBB
AD AAA
AD CCC

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