-
Notifications
You must be signed in to change notification settings - Fork 1.1k
SERP Settings Sync: Add and update pixels #7073
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
Merged
mikescamell
merged 5 commits into
develop
from
feature/mike/serp-settings-sync/open-duck-ai-pixel
Nov 19, 2025
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ed1ffc1
Add pixels
mikescamell cd6577c
SERP Settings Sync: Implement pixel tracking for Open Duck AI settings
mikescamell 9149a4b
Add and update tests for pixel and screen launching
mikescamell 7026942
Update pixel tracking for hiding AI generated images
mikescamell 824bbce
Add test
mikescamell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| // See https://app.asana.com/1/137249556945/project/1207908166761516/task/1211846254913290 | ||
| { | ||
| "serp_settings_open_hide-ai-generated-images": { | ||
| // See DuckChatSettingsViewModel.kt for usage. | ||
| "description": "When the `Hide Ai Generated` option is opened and highlighted in SERP settings.", | ||
| "owners": ["mikescamell"], | ||
| "triggers": ["other"], | ||
| "suffixes": ["form_factor"], | ||
| "parameters": ["appVersion"] | ||
| }, | ||
| "serp_settings_open_duck-ai": { | ||
| // See OpenNativeSettingsHandler.kt for usage. | ||
| "description": "When a user clicks the 'Open Duck.AI button' in the SERP settings menu which takes them to AI Features settings page.", | ||
| "owners": ["mikescamell"], | ||
| "triggers": ["other"], | ||
| "suffixes": ["form_factor"], | ||
| "parameters": ["appVersion"] | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...-impl/src/main/java/com/duckduckgo/settings/impl/serpsettings/pixel/SerpSettingsPixels.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| /* | ||
| * Copyright (c) 2025 DuckDuckGo | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package com.duckduckgo.settings.impl.serpsettings.pixel | ||
|
|
||
| import com.duckduckgo.app.statistics.pixels.Pixel | ||
| import com.duckduckgo.common.utils.plugins.pixel.PixelParamRemovalPlugin | ||
| import com.duckduckgo.common.utils.plugins.pixel.PixelParamRemovalPlugin.PixelParameter | ||
| import com.duckduckgo.di.scopes.AppScope | ||
| import com.duckduckgo.settings.impl.serpsettings.pixel.SerpSettingsPixelName.SERP_SETTINGS_OPEN_DUCK_AI | ||
| import com.squareup.anvil.annotations.ContributesMultibinding | ||
| import javax.inject.Inject | ||
|
|
||
| enum class SerpSettingsPixelName(override val pixelName: String) : Pixel.PixelName { | ||
| SERP_SETTINGS_OPEN_DUCK_AI("serp_settings_open_duck-ai"), | ||
| } | ||
|
|
||
| @ContributesMultibinding(AppScope::class) | ||
| class SerpSettingsPixelParamRemovalPlugin @Inject constructor() : PixelParamRemovalPlugin { | ||
| override fun names(): List<Pair<String, Set<PixelParameter>>> { | ||
| return listOf( | ||
| SERP_SETTINGS_OPEN_DUCK_AI.pixelName to PixelParameter.removeAtb(), | ||
| ) | ||
| } | ||
| } |
58 changes: 58 additions & 0 deletions
58
...rc/test/java/com/duckduckgo/settings/impl/serpsettings/fakes/FakeGlobalActivityStarter.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| /* | ||
| * Copyright (c) 2025 DuckDuckGo | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package com.duckduckgo.settings.impl.serpsettings.fakes | ||
|
|
||
| import android.content.Context | ||
| import android.content.Intent | ||
| import android.os.Bundle | ||
| import com.duckduckgo.navigation.api.GlobalActivityStarter | ||
| import com.duckduckgo.navigation.api.GlobalActivityStarter.ActivityParams | ||
|
|
||
| class FakeGlobalActivityStarter : GlobalActivityStarter { | ||
| val startedActivities = mutableListOf<ActivityParams>() | ||
| val startedDeeplinkActivities = mutableListOf<GlobalActivityStarter.DeeplinkActivityParams>() | ||
| var intentToReturn: Intent? = null | ||
|
|
||
| override fun start( | ||
| context: Context, | ||
| params: ActivityParams, | ||
| options: Bundle?, | ||
| ) { | ||
| startedActivities.add(params) | ||
| } | ||
|
|
||
| override fun start( | ||
| context: Context, | ||
| deeplinkActivityParams: GlobalActivityStarter.DeeplinkActivityParams, | ||
| options: Bundle?, | ||
| ) { | ||
| startedDeeplinkActivities.add(deeplinkActivityParams) | ||
| } | ||
|
|
||
| override fun startIntent(context: Context, params: ActivityParams): Intent? { | ||
| startedActivities.add(params) | ||
| return intentToReturn | ||
| } | ||
|
|
||
| override fun startIntent( | ||
| context: Context, | ||
| deeplinkActivityParams: GlobalActivityStarter.DeeplinkActivityParams, | ||
| ): Intent? { | ||
| startedDeeplinkActivities.add(deeplinkActivityParams) | ||
| return intentToReturn | ||
| } | ||
| } |
57 changes: 57 additions & 0 deletions
57
.../settings-impl/src/test/java/com/duckduckgo/settings/impl/serpsettings/fakes/FakePixel.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| /* | ||
| * Copyright (c) 2025 DuckDuckGo | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package com.duckduckgo.settings.impl.serpsettings.fakes | ||
|
|
||
| import com.duckduckgo.app.statistics.pixels.Pixel | ||
|
|
||
| class FakePixel : Pixel { | ||
| val firedPixels = mutableListOf<String>() | ||
|
|
||
| override fun fire( | ||
| pixel: Pixel.PixelName, | ||
| parameters: Map<String, String>, | ||
| encodedParameters: Map<String, String>, | ||
| type: Pixel.PixelType, | ||
| ) { | ||
| firedPixels.add(pixel.pixelName) | ||
| } | ||
|
|
||
| override fun fire( | ||
| pixelName: String, | ||
| parameters: Map<String, String>, | ||
| encodedParameters: Map<String, String>, | ||
| type: Pixel.PixelType, | ||
| ) { | ||
| firedPixels.add(pixelName) | ||
| } | ||
|
|
||
| override fun enqueueFire( | ||
| pixel: Pixel.PixelName, | ||
| parameters: Map<String, String>, | ||
| encodedParameters: Map<String, String>, | ||
| ) { | ||
| firedPixels.add(pixel.pixelName) | ||
| } | ||
|
|
||
| override fun enqueueFire( | ||
| pixelName: String, | ||
| parameters: Map<String, String>, | ||
| encodedParameters: Map<String, String>, | ||
| ) { | ||
| firedPixels.add(pixelName) | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do we want to move this to the settings module even though it's only fired here?
If we do then we'll need to make an API proposal to expose it.
I'm not sure it's worth it, we only renamed it to match other platforms.
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.
I think is fine leaving it here