Trying to conceive

So to get pregnant do you need to have sex on the ovulation day or days before ovulation?