jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/343106 )

Change subject: Add tracking of sister projects and positions
......................................................................


Add tracking of sister projects and positions

Adds a list of sister results and their positions as extraParams
to SERP events so we can tell from TSS2 data which projects were
shown to the user without having to merge with search logs. For
example:

[{"result":"image","position":0},
 {"result":"book","position":1},
 {"result":"course","position":2}]

I'm not sure if this is the best approach and I'm probably
missing something important...

Bug: T160463
Change-Id: If0760769ce693da8162a207e18e84a5055cc7bca
(cherry picked from commit 17d63749f78092c415db5e10546864a3e20c6029)
---
M modules/ext.wikimediaEvents.searchSatisfaction.js
1 file changed, 14 insertions(+), 1 deletion(-)

Approvals:
  EBernhardson: Looks good to me, approved
  Bearloga: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/modules/ext.wikimediaEvents.searchSatisfaction.js 
b/modules/ext.wikimediaEvents.searchSatisfaction.js
index 494ac8d..8e2a099 100644
--- a/modules/ext.wikimediaEvents.searchSatisfaction.js
+++ b/modules/ext.wikimediaEvents.searchSatisfaction.js
@@ -531,7 +531,8 @@
         */
        function setupSearchTest( session ) {
                var params,
-                       logEvent = genLogEventFn( 'fulltext', session );
+                       logEvent = genLogEventFn( 'fulltext', session ),
+                       iwResultSet;
 
                if ( isSearchResultPage ) {
                        // When a new search is performed reset the session 
lifetime.
@@ -602,6 +603,18 @@
                                hitsReturned: $( '.mw-search-result-heading' 
).length
                        };
 
+                       // Track which sister wiki results were shown in the 
sidebar and in what order
+                       if ( session.has( 'subTest' ) ) {
+                               iwResultSet = [];
+                               $( 'li.iw-resultset' ).each( function () {
+                                       iwResultSet.push( {
+                                               result: $( this ).attr( 'class' 
).match( /(?:^|\s)iw-resultset--(\S+)/ )[ 1 ],
+                                               position: $( this ).data( 
'iw-resultset-pos' )
+                                       } );
+                               } );
+                               params.extraParams = JSON.stringify( 
iwResultSet );
+                       }
+
                        // Track what did you mean suggestions were displayed 
on the page
                        if ( $( '#mw-search-DYM-suggestion' ).length ) {
                                params.didYouMeanVisible = 'yes';

-- 
To view, visit https://gerrit.wikimedia.org/r/343106
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If0760769ce693da8162a207e18e84a5055cc7bca
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaEvents
Gerrit-Branch: wmf/1.29.0-wmf.16
Gerrit-Owner: EBernhardson <[email protected]>
Gerrit-Reviewer: Bearloga <[email protected]>
Gerrit-Reviewer: EBernhardson <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to