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

Add Brave Ads status header to search.brave.com calls #25430

Closed
jsecretan opened this issue Sep 15, 2022 · 6 comments · Fixed by brave/brave-core#15147
Closed

Add Brave Ads status header to search.brave.com calls #25430

jsecretan opened this issue Sep 15, 2022 · 6 comments · Fixed by brave/brave-core#15147

Comments

@jsecretan
Copy link

Description

In preparation for Brave Ads on Brave Search, it is helpful for the Brave Search backend to understand whether the requesting browser has Brave Ads enabled. As such we should add the header X-Brave-Ads-Enabled: 1 to any call to Brave Search (and it's associated dev/staging environments) whether originating from the main search box or the Omnibox.

This can hopefully use some of the same mechanisms that have been used in the past on this, e.g. https://github.com/brave/brave-browser/wiki/Custom-Headers. When the work is complete, please add an appropriate description to this page: https://github.com/brave/brave-browser/wiki/Custom-Headers.

@btlechowski
Copy link

btlechowski commented Nov 14, 2022

Verification passed on

Brave 1.46.83 Chromium: 107.0.5304.68 (Official Build) beta (64-bit)
Revision a4e93e89d3b3df1be22214603fba846ad0183ca5-refs/branch-heads/5304@{#991}
OS Ubuntu 18.04 LTS

Verified test plan from brave/brave-core#15147

https://search.brave.com/

Clean profile

X-Brave-Ads-Enabled: 1 is not included in the request
image

Ads enabled

X-Brave-Ads-Enabled: 1 is included in the request

image

Ads disabled

X-Brave-Ads-Enabled: 1 is not included in the request

image

@LaurenWags
Copy link
Member

Removing QA Pass-Linux as this is being uplifted to 1.45.x where it will need to be retested. In the event that there is not another 1.45.x build, the label can be re-added.

@LaurenWags
Copy link
Member

Requires 1.45.129 or higher to test.

@btlechowski
Copy link

btlechowski commented Nov 17, 2022

Verification passed on

Brave 1.45.129 Chromium: 107.0.5304.110 (Official Build) (64-bit)
Revision 2a558545ab7e6fb8177002bf44d4fc1717cb2998-refs/branch-heads/5304@{#1202}
OS Ubuntu 18.04 LTS

Verified test plan from brave/brave-core#15147

https://search.brave.com/

Clean profile

X-Brave-Ads-Enabled: 1 is not included in the request
image

Ads enabled

X-Brave-Ads-Enabled: 1 is included in the request

image

Ads disabled

X-Brave-Ads-Enabled: 1 is not included in the request

image

Ads enabled - Private window

X-Brave-Ads-Enabled: 1 is not included in the request

image

https://search.brave.software/

Clean profile

X-Brave-Ads-Enabled: 1 is not included in the request
image

Ads enabled

X-Brave-Ads-Enabled: 1 is included in the request

image

Ads disabled

X-Brave-Ads-Enabled: 1 is not included in the request

image


Verification passed on

Brave 1.45.129 Chromium: 107.0.5304.110 (Official Build) (64-bit)
Revision 2a558545ab7e6fb8177002bf44d4fc1717cb2998-refs/branch-heads/5304@{#1202}
OS Windows 10 Version 21H2 (Build 19044.2251)

Verified test plan from brave/brave-core#15147

https://search.brave.com/

Clean profile

X-Brave-Ads-Enabled: 1 is not included in the request
image

Ads enabled

X-Brave-Ads-Enabled: 1 is included in the request

image

Ads disabled

X-Brave-Ads-Enabled: 1 is not included in the request

image

@btlechowski
Copy link

Verification passed on Brave v1.45.129 on Samsung Galaxy Tab S5e (Android 11.0)

Verified test plan from brave/brave-core#15147

https://search.brave.com/

Clean profile

X-Brave-Ads-Enabled: 1 is not included in the request
image

Ads enabled

X-Brave-Ads-Enabled: 1 is included in the request

image

Ads disabled

X-Brave-Ads-Enabled: 1 is not included in the request

image

@Uni-verse
Copy link
Contributor

Uni-verse commented Nov 22, 2022

Verified on Samsung Galaxy S21 using the following build(s):

Brave	1.45.131 Chromium: 107.0.5304.110 (Official Build) (64-bit) 
Revision	2a558545ab7e6fb8177002bf44d4fc1717cb2998-refs/branch-heads/5304@{#1202}
OS	Android 12; Build/SP1A.210812.016

Clean profile

x-brave-ads-enabled: 1 is not appended to the header

Screen Shot 2022-11-22 at 11 41 57 AM

Ads Enabled

x-brave-ads-enabled: 1 is appended to the header

  • Verified searching in main search field in search.brave as well as using the omnibox appends the x-brave-ads-enabled header to the request when ads are enabled.

Screen Shot 2022-11-22 at 11 43 06 AM

Ads Disabled

  • Verified header is removed when ads are disabled after enabling

Screen Shot 2022-11-22 at 11 47 55 AM

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

Successfully merging a pull request may close this issue.

7 participants