Andrea, thanks for the additional feedback. These two videos, respectively, detail a reverse sneeze and a collapsing trachea, which are common in small breed dogs.
Because her coughing fits don't look exactly like either of this videos, it would be wise to have her seen by a veterinarian. There are many things that cause coughing, one of the most concerning is a cardiac cough and another is a cough because something has become lodged in the airway (some dogs do this often if they eat kibble too quickly).
When you describe a cough that is intermittent, it can be something that is truly happening randomly or it could be something that is happening infrequently and progressively getting worse. The fact that she keeps you up all night with these fits is a concern. Usually a reverse sneeze is random and short-lived. More advanced tracheal issues can be prolonged, but they usually last a few minutes (tops). Cardiac issues can be prolonged, as can allergic issues, although the latter seem to come on slowly, get worse, then get better over a long period of time.
In being seen by a veterinarian, there are a few things your vet can do to determine what may be causing this. First, during a physical exam, we can usually elicit a tracheal spasm by palpating the throat gently. If there is no tracheal involvement, this seldom happens. We can also listen to a pet's heart and determine if there is a murmur. Not all forms of cardiac disease occur with a murmur, but a substantial number of dogs with cardiac afflictions will have abnormal cardiac or lung sounds. As well, your vet may be able to witness what it is that you're seeing and determine how to handle the issue. Your vet may wish to do some chest xrays to see if there are abnormalities present and chose a medication regimen from that point forward.
Unfortunately, aside from antihistamines, there is little that we can do to treat coughs in pets without a prescription. However, if you wish to try antihistamines before going the veterinary route, see the attached link. http://cheyennewest.com/antihistamines-for-dogs-cats/
If my response has helped you, please kindly take the time to issue a positive rating. If questions remain, please reply and I will help you further. You will still be able to reach me after a rating has been issued. Best of luck with your little girl.