> Note: For the purpose of estimation of this task you can assume T211197 has been completed.
== Background
For several of the metrics envisaged in T210660, we need a way to distinguish which edits come from AMC. We would like to create a [[https://www.mediawiki.org/wiki/Manual:Tags |tag]] that identifies which edits come from users that have AMC enabled.
== Acceptance criteria
[] The new tag must be registered via [[ https://www.mediawiki.org/wiki/Manual:Hooks/ChangeTagsListActive | the ChangeTagsListActive hook ]]
[] The new tag is added inside [[ https://www.mediawiki.org/wiki/Manual:Hooks/RecentChange_save | onRecentChangeSave hook]]
[] Verify that the new tag also applies to all moderation actions to be counted as part of T210660 (e.g. it might need to appear in certain logs, analogously to how the existing "mobile web edit" tag [[https://en.wikipedia.org/wiki/Special:Log?type=create&user=&page=&wpdate=&tagfilter=mobile+web+edit |appears in the page creation log]]. Concrete list TBD in T213461)
== Developer notes
The hooks will need to check whether the user is an Advanced mobile contributions editor using a public method created inside T211197. We already do this for the 'mobile edit' tag and it should be relatively straightforward to mirror the logic there.
```
$rc->addTags( 'advanced mobile edit' );
```
NOTE: MobileFrontend confusingly binds the hook ChangeTagsListActive to onListDefinedTags. You can fix the method name as part of this change.
== QA steps
** blocked on updating reading web staging to the latest version and enabling AMC mode **
Article editing should be performed in mobile mode. Please verify both wikitext editor and visualeditor.
1. Visit https://en.wikipedia.beta.wmflabs.org/wiki/Special:Tags
# Observe that the `advanced mobile edit` tag exists
# Log in on stating environment, switch to mobile view
# Edit article, verify in the article history that edit is not tagged with `Advanced mobile edit` tag.
# Go to Special:MobileOptions and enable Advanced Mobile Contributions
# Edit article in mobile mode using Wikitext with Advanced Mobile Contributions enabled
# Go to the article history, that edit should be tagged as `Advanced mobile edit`
# Disable the AMC mode
# Edit article
# Verify that last article edit has no `Advanced mobile edit tag`
# Redo steps 5..8 but this time edit article with Visual Editor