Skip to content

Sponsored tiles

lmarceau edited this page Feb 20, 2025 · 5 revisions

What are they

Sponsored tiles are a type of tiles that is shown under the Top sites section in the Homepage. Sponsored tiles are shown to users by default, but the feature can be turned off in the settings by disabling "Sponsored Shortcuts" under "Shortcuts" in the Homepage settings menu. There's currently a maximum of 2 sponsored tiles that can show in the Top Sites section.

Testing

Tiles are served depending on your location. Some location might have no sponsored tiles, so you need to use a VPN to change your location sometimes. I've found that using a real device is more reliable for this purpose. For any questions, please ask in #ads-team-support.

Furthermore, you can also test with curl commands in a terminal to interact with the API. This following command will request some tiles from the Mars Unified Ads API.

curl -H Content-Type:application/json --data '{"context_id":"03267ad1-0074-4aa6-8e0c-ec18e0906bfe","placements":[{"placement":"newtab_mobile_tile_1","count":1},{"placement":"newtab_mobile_tile_2","count":1}]}
' -X POST https://ads.mozilla.org/v1/ads --header 'User-Agent: '\''Mozilla/5.0 (Android 13; Mobile; rv:92.0) Gecko/92.0 Firefox/92.0'\'''

Feature flag

We are currently switching to a new data source for the sponsored tiles from the legacy Contile API to the new Unified Ads API. We have a feature flag aiming to release with a rollout in v136. This API change is required to continue to be revenue compliant as part of the Terms of Use changes. In other words, we need to keep sending our impression and click telemetry for the sponsored tiles even if Glean cannot collect any telemetry events, and this is where the Unified Ads API comes into play.

As part of the migration, we are sending the old and the new telemetry pings at the same time to ensure our Looker dashboard continue to work. We're also using the same TelemetryContextualIdentifier.contextId in both legacy and the new Unified Ads API so we make sure we have no regression during this migration. This means even if the ToS are not accepted, we need to setup this TelemetryContextualIdentifier.contextId.

Data source

Sponsored tiles data comes from the ContileProvider or UnifiedAdsProvider, which both calls a Mozilla API to get the sponsored tile data. Once tiles are received, data is cached for either an hour or 30 minutes depending on the provider (see maxCacheAge).

Deduplication

We make sure no sponsored tiles click URLs appears in the following sections of the homepage:

  • Top sites
  • Jump back in
  • History Highlights (Recently saved)

This filtering is done through a search parameter, as defined in the SponsoredContentFilterUtility. There's currently some issues with this parameter that will need to be adjusted with this task.

We also make sure that if a user has a default search engine of that website, we don't add a sponsored tile of that type. Example; a user has Youtube as their default search engine, then we won't show a sponsored tile of Youtube.

Clone this wiki locally