Adding a query string to menu items determined by the current node?
The menu is cached. You could disable caching and add the query string to the options of the url in hook_link_alter, but this is not good for performance. So this would be better solved in javascript. You can prepare the link in php by setting an attribute, so that you can easily find the link later in the client and attach the query string.