We study the effects of experimental design on male and female behavior in a dictator game. Following social identity we investigate how experimental procedure may affect outcome through gender priming, i.e. the activation of gender stereotypes specifying that women behave altruistically and men egoistically. We prime subjects by asking them to indicate their gender in a questionnaire, before playing the game. In our experiment, such gender priming is effective (i.e. creates a gender difference in generosity) in gender-mixed environments, but not in single-sex environments. Further, men are more sensitive to priming than women are.