My 8 year old often complains that her stomach hurts. What could be going on?

Dyspepsia. A child age 8 should have no complaints like this except on rare occasion from something she eats. If steady complaints it is called dyspepsia usually. A vague term for stomach digestive symptoms. This in my opinion requires a doctor visit to get to real reason. Ulcers are uncommon, bowel problems are uncommon etc. This is best resolved by good family doc or good pediatrician.
Abdominal migraine? 2-3% of children have abdominal migraine, the equivalent of adult with migraine in the head! at times, stress/problems at school such as being bullied/picked-on can causse child to come up with such symptoms, thus u should try to find out..More pain during school days, and no problem during weekend may be good clues etc..She may have genuine problem too..So consult doc for an eval..Good luck.