Having fertility problems may raise your risk of an ectopic pregnancy. Medications that cause ovulation are sometimes used to treat fertility problems. These medications increase the risk of ectopic pregnancy.