There are many ways to do this, including securing the files themselves (tricky), or just making your game not run unless it's hosted where it's meant to be hosted.
For example, you could use the Browser object to see where the game is currently being run. Set something like this in your first layout:
If System: Browser.URL = "https://your-company.itch.io/game-name" then load up the game. Otherwise just don't do anything (or show the user a message).
And definitely minify your code!
Anything can be spoofed/hacked/circumvented. I remember releasing a Unity game on Steam and literally that same day it was on the torrents. Sadly there are always going to be thieves :(