I have a dog that's been scratching almost obsessively since he was a puppy and after 2 years of wearing a cone, we narrowed down the possibilities from diet, exercise, anything the vet could think of.
We have gone through maybe 4 vets and so much medication and it's not right for anyone to be taking so much medication because of liver or kidney damage in the long term.
We did an allergens test to detect ALL the possible allergens our dog was prone to and found out he was allergic to pollen, the poor thing.
So it's worth talking to a good vet and really monitoring your pet. We now give our dog evening primrose oil about 3 times a week and it has helped tremendously. There were other treatments such as injecting him with a pollen vaccination everyday for a year but we didn't find that too humane.