I think this form of deterrent is pretty common. A lot of people suggested it to me when I got my pup. My squirt bottle only has a fine mist setting, so it didn't seem to bother him much

. I've also tried putting pennies in a soda can and shaking it. The noise startles them out of the unwanted behavior such as barking. Then you praise them for being quiet.