Page MenuHomePhabricator

Wikifunctions fragments: Add usage tracking as page properties to the pages when we're used
Open, In Progress, HighPublic

Description

Description

We currently can’t track whether Wikifunctions are embedded in Wikipedias and Wiktionaries. This task adds instrumentation, discussed with Product Analytics, to enable the creation of a high-level adoption dashboard for embedded Wikifunctions.

In the WikifunctionsPFragmentHandler, when we are triggered on a page we should add details of our usage to the page properties table (below), which will allow maintenance scripts and analytics to track usage.

[Note: page props are ephemeral parse-time data only related to the current revision.]

Desired behavior/Acceptance criteria

  • We set a boolean flag prop on any Wikifunctions-using page
  • We can extract this data to find pages with fragments (in the current revision)
  • We set a string prop on from each fragment on the page page with the ZID of the Function called
  • We can extract this data to find pages with fragments using a particular Function

Completion checklist

Event Timeline

Change #1231023 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikiLambda@master] WikifunctionsPFragmentHandler: Add usage tracking as page properties to the pages when we're used

https://gerrit.wikimedia.org/r/1231023

Change #1231023 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] WikifunctionsPFragmentHandler: Add usage tracking props when we're used

https://gerrit.wikimedia.org/r/1231023

When the above patch is deployed:

  • All pages currently using 1+ embedded Wikifunctions calls will (after the next parse) have the wikilambda page property set. This should let us find (and count) the number of pages with a Wikifunctions call.

&

  • All pages currently using a given embedded Wikifunctions call will have the wikilambda-Z<id> page property set. This should let us find (and count) the number of pages with a call to a specific Function.

This should suffice for our analytical needs, but let's verify.