I'm pretty new to Drupal 8. I'm trying to figure out how to programmatically add a query string to a menu item link, the specific query string is determined by the node/page the user is currently on.
For example, I've got a link on my primary menu that goes to http://www.example.com
If I'm on the 'about me' page I want the link to add a query string of '?origin=about'. (http://www.example.com?origin=about)
If I'm on the 'contact me' page I want the link to add '?origin=contact', etc.
Are there any modules where this can be done, or how might I go about doing this myself?