== Steps to reproduce
# Visit https://en.m.wikipedia.org
# Login
# Enable "Advanced mode"
# Visit https://en.m.wikipedia.org/wiki/Maybeshewill
# Open the user menu button or the page actions overflow menu
== Expected results
- A MobileWebUIActionsTracking event is sent without the `destination` field set
== Actual results
- A MobileWebUIActionsTracking event is sent with the `destination` field set to `null`
== Environments observed
All environments where the MobileWebUIActionsTracking instrumentation is enabled.
=== Check any additional observations
✓ Observed on the [[ https://en.wikipedia.beta.wmflabs.org/wiki/Barack_Obama | beta cluster wiki ]]
✓ Observed on a [[ https://en.wikipedia.org/wiki/Barack_Obama | production wiki ]]
[x] Observed on [[ https://en.wikipedia.org/wiki/Barack_Obama | Vector desktop skin ]]
✓ Observed on [[ https://en.m.wikipedia.org/wiki/Barack_Obama | MinervaNeue skin ]]
✓ Observed while logged in
[x] Observed while //not// logged in (anonymous)
== Notes
[[ https://logstash.wikimedia.org/goto/b476ac495ba877c2350dc36add1d9f51 | 418 "None is not of type 'string'" errors were in the last 24 hours ]] for the MobileWebUIActionsTracking schema. All of those erroneous events have the `destination` property explicitly set to `null`. Because the property is present, it's validated.
One solution is to not set the property when it doesn't have a value, i.e. in `ext.wikimediaEvents.mobileWebUIActions.js` change:
```lang=js,name=[0]
var element = event.target,
name = element.getAttribute( 'data-event-name' );
if ( name ) {
schemaMobileWebUIActionsTracking.log( {
action: 'click',
name: name,
token: user.sessionId(),
destination: element.getAttribute( 'href' )
} );
}
```
to
```lang=js,name=[1]
var element = event.target,
name = element.getAttribute( 'data-event-name' )
destination, event;
if ( !name ) {
return;
}
event = {
action: 'click',
name: name,
token: user.sessionId()
}
destination = element.getAttribute( 'href' );
if ( destination ) {
event.destination = destination;
}
schemaMobileWebUIActionsTracking.log( event )
;
```