If she has always done this, then its probably some sort of short seizure or genetic flaw. If it doesn't effect her quality of life, I wouldn't worry too much about it. Keep an eye out for altered personality, staggering, drooling, uneven pupils or peeing on herself.
I do suggest having her checked out by a vet for safety reasons.
I don't know the breed but some spaniels have fainting/shaking conditions that are genetic.
The gagging is more worrisome than the passing out. Unless she is a flat faced breed, those dogs just make horrendous noises when they sleep.