What you are describing in your 9 yr old Cocker-BEagle sounds very much like Kennel Cough.
It really sounds like a primary coughing problem, not vomiting as there is never bile or food in what she is bringing up. Also, she is eating and does not have diarrhea, which again points away from the intestinal tract being the problem.
Let me explain...
Kennel cough (Bordetella, infectious tracheobronchitis) is a highly contagious cough that is transmitted by saliva or through an aerosol when a dog coughs.
With kennel cough, dogs have a cough that sounds like something is stuck in their throat, and after coughing a few times they have what is called a "terminal gag" which means that they sound like they are bringing up phlegm.
If you watch closely, you will often see dogs swallow after this final gag - they are in fact swallowing phlegm.
Some dogs will even cough up a puddle of clear, whitish, or slightly yellow mucoid fluid.
Kennel cough is highly contagious so dogs that have this should be kept isolated from other dogs for 2-3 weeks until it resolves.
It is possible that your dog got this from another dog walking by the yard, or by picking up a stick that was in the mouth of another dog that had kennel cough, or you could even have brought it home on your shoes/pants if you passed a dog that had kennel cough. It is HIGHLY contagious - just as the cold and flu viruses are for humans.
The incubation period (time from when she was exposed to it, until time he starts showing symptoms) is anywhere from 3 to 10 days.
Most cases resolve without medications, but in some cases patients are put on antibiotics and/or cough suppressants.
Antibiotics are used in dogs who are at risk for a secondary pneumonia (very young or very old dogs, or those with a suppressed immune system).
Cough suppressants are used when the cough is so severe that the dog cannot sleep. There can be quite a bit of phlegm with kennel cough, and it is better that the dog DOES cough that up, rather than leave it in the lungs by suppressing the cough. However, there has to be a balance where it's possible for the dog and his human companions to sleep.
For dogs that are unable to sleep, I do sometimes advise owners of my patients that they can give cough syrup. I advise them that it is very important to read the label carefully and find a cough medicine that contains ONLY dextromethorphan (DM). This can be given to dogs.Talk to your vet about whether this is ok for your dog!
Here is more about precautions and dose:
Watch your dog to see if she is retching or gagging at the end of her coughing episode. Since it sounds like she is, and because she is coughing up puddles of phlegm, she likely has kennel cough. Many dogs will vomit due to the intensity of the coughing.
I'll give you links to further information:
If she coughs up fluid that is green, or is blood-tinged, or she is lethargic or has difficulty breathing, then you should definitely see a vet.
Many dogs with Kennel Cough seem to have a sore throat and thus don't want to eat their dry food. You can soften it with warm water to make it easier to swallow.
Keep your dog isolated from other dogs for at least 2 weeks! Keep her as quiet as possible - just out for potty breaks and back in. Kennel cough usually gets worse for 2-3 days, then frequent coughing with phlegm for 2-3 days, then starts to slowly get better.
It is also helpful to walk dogs with Kennel cough on a head halter or chest halter, as a leash around the neck can pull on the trachea and start a coughing spell.
I do hope that this helps you to help your dog!
Best wishes to you and to your dog!