You can use Logitech G HUB to enable Automatic Game Detection mode on your gaming mouse. Here’s how:
If your mouse is wireless, make sure that it’s connected to your computer using the supplied USB cable or the wireless USB receiver.
Launch G HUB, select your gaming mouse and navigate to the lock symbol — make sure that it is unlocked.
The mouse will now be in Automatic Game Detection mode and all of the customizations you make in G HUB will be active when the corresponding game or application is launched or running on your computer.