Our Boston terrier used to have the same problem, it stopped when we changed the food we were giving to him. Our vet told us something about sodium in its food, I was surprised because we were giving him Royal Canin which I assumed was a good brand,
I hope your dog gets better