Mercaptan should be added to the water sprayed by water cannons when anarchists riot. Not only will it immediately convince them to stop being violent, they will be marked with the odor until they change their clothes and shower, which given their personal habits, might be a long time.
Police will need to be more accurate to avoid spraying their own personnel, but they should not hesitate to use it against anarchists throwing stones, bottles, and other projectiles. To avoid tainting the entire water cannon vehicle, the mercaptan should be injected at the exit nozzle, which will also allow for the vehicles to be used for both regular crowd control and punishing anarchists.
And best of all, anarchists wearing balaclavas or masks which become soaked with mercaptan will not be able to escape the nasty smell as it enters their air passages with every breath. They will be coerced into removing their face coverings, with police cameras then being able to positively identify them.