Recent research has shown the potential for nonallopatric speciation, but we lack an adequate understanding of the mechanisms of prezygotic barriers and how these evolve in the presence of gene flow. The marine snail Littorina saxatilis has distinct ecotypes in different shore microhabitats. Ecotypes hybridize in contact zones, but gene flow is impeded by assortative mating. Earlier studies have shown that males and females of the same ecotype copulate for longer than mates of different ecotype. Here we report a new mechanism that further contributes to reproductive isolation between ecotypes in the presence of gene flow. This mechanism is linked to the ability of males to track potential partners by following their mucous trail. We show that cliff ecotype males follow the trails of females of the same ecotype for longer than females of the alternate (boulder) ecotype. In addition, cliff males are more likely to follow the mucous trail in the correct direction if the trail is laid by a cliff-female. The capacity to discriminate the ecotype of female mucous trails combined with differential copulation times creates a strong prezygotic reproductive barrier between ecotypes of L. saxatilis that reduces gene flow from cliff to boulder ecotypes by ≥80%.