For diseases such as genital herpes, which persist in the body, the primary infection occurred at the time when you were initially exposed to the herpes simplex virus - whether or not you had an outbreak. This is important to understand since different herpes blood tests have differing abilities to pick up new, primary infections compared to long-standing or recurring infections. Herpes IgM tests are a better marker of early primary infections, while herpes IgG tests are consistent with chronic/recurrent infections.
Similarly, early, primary HIV infections may not show up on blood tests, even though individuals still have enough virus in their bodies to infect their partners. Early HIV transmission, which takes place during the time before people begin to test positive, is a significant public health problem.
Note: The term secondary infection has a specific meaning that does not refer to the second time you are infected with an organism.