Skip to content
This repository was archived by the owner on Feb 20, 2023. It is now read-only.

For #20229 - Use the AC common implementation for ads/search telemetry #20230

Merged
merged 1 commit into from
Jul 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 0 additions & 11 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -741,14 +741,3 @@ ext.updateExtensionVersion = { task, extDir ->
expand(values)
}
}

tasks.register("updateAdsExtensionVersion", Copy) { task ->
updateExtensionVersion(task, 'src/main/assets/extensions/ads')
}

tasks.register("updateCookiesExtensionVersion", Copy) { task ->
updateExtensionVersion(task, 'src/main/assets/extensions/cookies')
}

preBuild.dependsOn "updateAdsExtensionVersion"
preBuild.dependsOn "updateCookiesExtensionVersion"
9 changes: 6 additions & 3 deletions app/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4235,11 +4235,12 @@ browser.search:
- https://github.com/mozilla-mobile/fenix/pull/10112
- https://github.com/mozilla-mobile/fenix/pull/15713#issuecomment-703972068
- https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789
- https://github.com/mozilla-mobile/focus-android/pull/4968#issuecomment-879256443
data_sensitivity:
- interaction
notification_emails:
- android-probes@mozilla.com
expires: "2021-08-01"
expires: "2022-07-01"
ad_clicks:
type: labeled_counter
description: |
Expand All @@ -4253,11 +4254,12 @@ browser.search:
- https://github.com/mozilla-mobile/fenix/pull/10112
- https://github.com/mozilla-mobile/fenix/pull/15713#issuecomment-703972068
- https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789
- https://github.com/mozilla-mobile/focus-android/pull/4968#issuecomment-879256443
data_sensitivity:
- interaction
notification_emails:
- android-probes@mozilla.com
expires: "2021-08-01"
expires: "2022-07-01"
in_content:
type: labeled_counter
description: |
Expand All @@ -4270,11 +4272,12 @@ browser.search:
- https://github.com/mozilla-mobile/fenix/pull/10167
- https://github.com/mozilla-mobile/fenix/pull/15713#issuecomment-703972068
- https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789
- https://github.com/mozilla-mobile/focus-android/pull/4968#issuecomment-879256443
data_sensitivity:
- interaction
notification_emails:
- android-probes@mozilla.com
expires: "2021-08-01"
expires: "2022-07-01"

addons:
open_addons_in_settings:
Expand Down
61 changes: 0 additions & 61 deletions app/src/main/assets/extensions/ads/ads.js

This file was deleted.

28 changes: 0 additions & 28 deletions app/src/main/assets/extensions/ads/adsBackground.js

This file was deleted.

40 changes: 0 additions & 40 deletions app/src/main/assets/extensions/ads/manifest.template.json

This file was deleted.

47 changes: 0 additions & 47 deletions app/src/main/assets/extensions/cookies/cookies.js

This file was deleted.

28 changes: 0 additions & 28 deletions app/src/main/assets/extensions/cookies/cookiesBackground.js

This file was deleted.

38 changes: 0 additions & 38 deletions app/src/main/assets/extensions/cookies/manifest.template.json

This file was deleted.

13 changes: 7 additions & 6 deletions app/src/main/java/org/mozilla/fenix/components/Core.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ import mozilla.components.feature.pwa.ManifestStorage
import mozilla.components.feature.pwa.WebAppShortcutManager
import mozilla.components.feature.readerview.ReaderViewMiddleware
import mozilla.components.feature.recentlyclosed.RecentlyClosedMiddleware
import mozilla.components.feature.search.middleware.AdsTelemetryMiddleware
import mozilla.components.feature.search.middleware.SearchMiddleware
import mozilla.components.feature.search.region.RegionMiddleware
import mozilla.components.feature.search.telemetry.ads.AdsTelemetry
import mozilla.components.feature.search.telemetry.incontent.InContentTelemetry
import mozilla.components.feature.session.HistoryDelegate
import mozilla.components.feature.session.middleware.LastAccessMiddleware
import mozilla.components.feature.session.middleware.undo.UndoMiddleware
Expand Down Expand Up @@ -76,8 +79,6 @@ import org.mozilla.fenix.historymetadata.HistoryMetadataService
import org.mozilla.fenix.media.MediaSessionService
import org.mozilla.fenix.perf.StrictModeManager
import org.mozilla.fenix.perf.lazyMonitored
import org.mozilla.fenix.search.telemetry.ads.AdsTelemetry
import org.mozilla.fenix.search.telemetry.incontent.InContentTelemetry
import org.mozilla.fenix.settings.SupportUtils
import org.mozilla.fenix.settings.advanced.getSelectedLocale
import org.mozilla.fenix.telemetry.TelemetryMiddleware
Expand Down Expand Up @@ -195,7 +196,6 @@ class Core(
ReaderViewMiddleware(),
TelemetryMiddleware(
context.settings(),
adsTelemetry,
metrics
),
ThumbnailsMiddleware(thumbnailStorage),
Expand All @@ -207,7 +207,8 @@ class Core(
migration = SearchMigration(context)
),
RecordingDevicesMiddleware(context),
PromptMiddleware()
PromptMiddleware(),
AdsTelemetryMiddleware(adsTelemetry)
)

if (FeatureFlags.historyMetadataFeature) {
Expand Down Expand Up @@ -268,11 +269,11 @@ class Core(
}

val adsTelemetry by lazyMonitored {
AdsTelemetry(metrics)
AdsTelemetry()
}

val searchTelemetry by lazyMonitored {
InContentTelemetry(metrics)
InContentTelemetry()
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import mozilla.components.feature.media.facts.MediaFacts
import mozilla.components.feature.prompts.facts.LoginDialogFacts
import mozilla.components.feature.prompts.facts.CreditCardAutofillDialogFacts
import mozilla.components.feature.pwa.ProgressiveWebAppFacts
import mozilla.components.feature.search.telemetry.ads.AdsTelemetry
import mozilla.components.feature.search.telemetry.incontent.InContentTelemetry
import mozilla.components.feature.syncedtabs.facts.SyncedTabsFacts
import mozilla.components.feature.top.sites.facts.TopSitesFacts
import mozilla.components.lib.dataprotect.SecurePrefsReliabilityExperiment
Expand Down Expand Up @@ -315,6 +317,15 @@ internal class ReleaseMetricController(
Event.SecurePrefsReset
}

Component.FEATURE_SEARCH to AdsTelemetry.SERP_ADD_CLICKED -> {
Event.SearchAdClicked(value!!)
}
Component.FEATURE_SEARCH to AdsTelemetry.SERP_SHOWN_WITH_ADDS -> {
Event.SearchWithAds(value!!)
}
Component.FEATURE_SEARCH to InContentTelemetry.IN_CONTENT_SEARCH -> {
Event.SearchInContent(value!!)
}
else -> null
}

Expand Down
Loading