Page MenuHomePhabricator

Track number of article placeholder clicks from search results
Closed, ResolvedPublic5 Story Points


To see how many of our clicks come through Special:Search and not via direct links, search engines (in the future), etc.

We could either track clicks on the links via JS, or track it server side by using a ref=search GET parameter. It might also work to analyze the referrer data already available.

Event Timeline

hoo created this task.Aug 14 2016, 9:57 PM
Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptAug 14 2016, 9:57 PM
Addshore set the point value for this task to 5.
Lucie moved this task from Incoming to To Do Next on the ArticlePlaceholder board.Aug 15 2016, 1:17 PM

@hoo @Lucie so I just took a quick look at the webrequest data and getting the numbers via that means will be fine and would provide us with daily data. An example entry can be seen below..


As we already do we can identify when the AboutTopic special page has been hit by using the 'special' element of the x_analytics header which would be 'AboutTopic' for the page in all languages (alongside a ns of -1)

Matching Special:Search from the referrer will be slightly harder, as we can not use the namespace to match the string as it is different in different languages (and there is no sort of normalisation done (we could of course come up with some crazy normalisation)
The parameters in the URL however will always be there, so we could match referers that include a search= param and maybe a searchToken? and also make sure that the referer hostname is the same as the uri hostname?


hoo added a comment.Aug 15 2016, 6:00 PM

Referrer has same host name and contains [?&]search and maybe a title with a colon sounds fine with me and would probably be robust against changes in Special:Search.

So something like this looks pretty solid.

SELECT * from wmf.webrequest
WHERE year = 2016
    AND month = 08
    AND day = 20
    AND webrequest_source = 'text'
    AND x_analytics_map["ns"] = '-1'
    AND x_analytics_map["special"] = 'AboutTopic'
    AND normalized_host.project_class = 'wikipedia'
    AND referer rlike '^.*search=.*$'
    AND referer rlike '^.*wikipedia\.org.*$'

Change 305989 had a related patch set uploaded (by Addshore):
WikidataArticlePlaceholderMetrics also send search referral data

Lucie moved this task from To Do Next to Review on the ArticlePlaceholder board.Aug 23 2016, 10:56 AM
thiemowmde triaged this task as Normal priority.Sep 5 2016, 2:53 PM
Addshore moved this task from Proposed to Sprint ready on the WMDE-QWERTY-Team board.

Change 305989 merged by jenkins-bot:
WikidataArticlePlaceholderMetrics also send search referral data

This is now just pending a deployment

Addshore closed this task as Resolved.Dec 5 2016, 11:33 AM
Addshore moved this task from Active ๐Ÿš to Closing โœ”๏ธ on the User-Addshore board.
Addshore moved this task from Done to Demoed on the WMDE-QWERTY-Team board.Dec 6 2016, 3:12 PM
hoo moved this task from Review to Done on the ArticlePlaceholder board.Dec 13 2016, 10:07 AM