Catrope has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/352296 )

Change subject: Track clicks on the "top links" on the RC page
......................................................................

Track clicks on the "top links" on the RC page

Only logging the href and the link text, because links vary
so widely between wikis and carry so little information
that there's not much else we can do.

Bug: T164617
Depends-On: I2934156af5aafa3162924ecf78cfd82d3a41370d
Change-Id: Ib2dcef4e549b1a911dcc2599c14f195bc17d274b
---
M extension.json
M modules/ext.wikimediaEvents.recentChangesClicks.js
2 files changed, 19 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaEvents 
refs/changes/96/352296/1

diff --git a/extension.json b/extension.json
index cae02a3..6b4b8bb 100644
--- a/extension.json
+++ b/extension.json
@@ -144,6 +144,11 @@
                        "schema": "ChangesListClickTracking",
                        "revision": 16484895
                },
+               "schema.RecentChangesTopLinks": {
+                       "class": "ResourceLoaderSchemaModule",
+                       "schema": "RecentChangesTopLinks",
+                       "revision": 16699164
+               },
                "ext.wikimediaEvents": {
                        "scripts": [
                                "ext.wikimediaEvents.events.js",
diff --git a/modules/ext.wikimediaEvents.recentChangesClicks.js 
b/modules/ext.wikimediaEvents.recentChangesClicks.js
index 64df4ed..cecc1c2 100644
--- a/modules/ext.wikimediaEvents.recentChangesClicks.js
+++ b/modules/ext.wikimediaEvents.recentChangesClicks.js
@@ -97,5 +97,19 @@
                        } );
                }
 
+               // Click tracking for top links (T164617)
+               $( '.mw-recentchanges-toplinks' ).on( 'click', 'a[href]', 
function ( e ) {
+                       var $link = $( this );
+
+                       if ( e.which === 3 ) {
+                               return;
+                       }
+
+                       mw.track( 'event.RecentChangesTopLinks', {
+                               url: $link.prop( 'href' ),
+                               label: $link.text()
+                       } );
+               } );
+
        } );
 }( jQuery, mediaWiki ) );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib2dcef4e549b1a911dcc2599c14f195bc17d274b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaEvents
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>

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

Reply via email to