Add tracking for when recipes from Drupal.org are applied

Created on 21 November 2024, 2 months ago

Problem/Motivation

Drupal.org will have recipe browsing and a recipe browsing API at some point. For the results to be good, we need to know what recipes are popular.

Right now, we have download numbers for recipes, like https://packagist.org/packages/drupal/events_recurring/stats. Those numbers aren’t necessarily great since it measures when composer is run with the recipe as a dependency. And the key action for a recipe is its application, not download.

It would be better to have an API, similar to update status. So we have metrics for when recipes are applied.

Proposed resolution

The server-side is ready: https://updates.drupal.org/recipe-applied. Our CDN returns a static synthetic response immediately. Like update status, the data will be in query parameters and then we do log analysis to get useful data.

Conditions for sending data:

  • Respect opt in/out options
  • When the recipe is applied
  • Only if the recipe is from Drupal.org, in the drupal/ namespace on Packagist.org, like https://packagist.org/packages/drupal/events_recurring
  • If there is a way to know if GitLab CI is being used, not sending for CI would be ideal

Data to send:

  • name recipe name, like events_recurring
  • site_key same arbitrary site key used by update status module
  • anything else we need?

The final request will be like https://updates.drupal.org/recipe-applied?name=events_recurring&site_key...

Drupal does not need to wait for a response.

Remaining tasks

Decide on any opt in/out options. This is the same privacy policy as update status data. We don’t collect the site URL, don’t share logs, only aggregate, anonymous summaries.

Finalize any other data collected.

Once the final query parameters are set and in core, we can start on the server-side log analysis. The math will be a bit different since recipes are applied once, not installed.

User interface changes

If there is a new opt in/out UI.

Introduced terminology

None

API changes

Not for Drupal as a client.

Data model changes

n/a

Release notes snippet

To be determined

Feature request
Status

Active

Version

11.0 🔥

Component

recipe system

Created by

🇺🇸United States drumm NY, US

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @drumm
  • 🇺🇸United States drumm NY, US

    Add version data to send

  • 🇺🇸United States chrisfromredfin Portland, Maine

    I'm not sure how the telemetry will work for doing the reporting, but I can say that there's a core event when a recipe is applied that is where we can know in code if it's happened and report it. Project Browser listens to that event here:

    https://git.drupalcode.org/project/project_browser/-/blob/2.0.x/src/Reci...

  • 🇬🇧United Kingdom catch

    Tagging as a Drupal CMS release target. If we were to implement this in update module, would that save an additional opt-in? It's almost exactly the same data that we already send from update module so might be fine. Then update module needs to do something with the event - would suggest adding it to a queue item, and then having the queue runner actually send the data so it's as light as possible when applying a recipe.

Production build 0.71.5 2024