Jump to content

Schema:PageLinkInteraction

PHP logging

EventLogging::logEvent( 'PageLinkInteraction', 18398516, $event );

extension.json setup for JavaScript logging

{
	"attributes": {
		"EventLogging": {
			"Schemas": {
				"PageLinkInteraction": 18398516
			}
		}
	}
}

JavaScript logging

mw.track( 'event.PageLinkInteraction', { /* ... */ } );
From Meta, a Wikimedia project coordination wiki
Revision 18398516
description"(This was a draft schema that ended up not being implemented, the events were integrated into Schema:Popups instead.) Page load and link interaction for Popups Extension (aka Hovercards) and in general. Events must only be sent for UAs supporting sendBeacon. Additionally, events must not be sent for UAs without hover capabilities (e.g., mobile touch only mode should not result in event logging)."
properties
action
type"string"
enum
"pageLoaded"
"dwelledButAbandoned"
description"`pageLoaded` happens once per page load. `dwelledButAbandoned` happens for the cases associated with `abandonmentAssociation`"
requiredtrue
popupEnabled
type"boolean"
description"Whether or not hovercards are enabled."
requiredtrue
abandonmentAssociation
type"string"
enum
"ineligible"
"abandonedEarly"
description"If user hovers for 250ms or more yet abandons `ineligible` - when hovercards is disabled or the link is ineligible for a preview `abandonedEarly` - when hovercards is enabled and the link is eligible for a preview but the user abandoned before the preview rendered"
requiredfalse
linkInteractionToken
type"string"
description"One time token representing interaction with a link. Set only on `action` = `dwellButAbandoned`. Refer to the Popups schema."
requiredfalse
pageToken
type"string"
description"One time token per page load. Refer to the Popups schema."
requiredtrue
sessionToken
type"string"
description"Session token that survives across pages (mw.user.sessionId()), but not browser restarts, used in deterministic user bucketing. Refer to the Popups schema."
requiredtrue
api
requiredfalse
type"string"
enum
"mwapi"
"restbase"
description"API endpoint consumed for preview data. `mwapi` for api.php or `restbase` for RESTbase. Set only when hovercards enabled."