Here's the list of hotels/Homestays/Camps:
In Hampi you can book your stay at Root's Cafe or Chinna's Camping or Hotel Varsha.
For Gokarna you may book your stay at I'm beach resort or Beach Beat or HosteLIT backpackers.
Do let me know if this was helpful!
Happy holidays!