From ScienceDaily:
Scientists at Tokyo Institute of Technology (Tokyo Tech) have discovered a gene that appears to play a vital role in pheromone sensing. The gene is conserved across fish and mammals and over 400 million years of vertebrate evolution, indicating that the pheromone sensing system is much more ancient than previously believed. This discovery opens new avenues of research into the origin, evolution, and function of pheromone signaling.
Most land-dwelling vertebrates have both an olfactory organ that detects odors and a vomeronasal organ that detects pheromones, which elicit social and sexual behaviors. It has traditionally been believed that the vomeronasal organ evolved when vertebrates transitioned from living in water to living on land. New research by Masato Nikaido and colleagues at Tokyo Tech, however, suggests that this organ may be much older than previously believed. Paper. (paywall) – Hikoyu Suzuki, Hidefumi Nishida, Hiro Kondo, Ryota Yoda, Tetsuo Iwata, Kanako Nakayama, Takayuki Enomoto, Jiaqi Wu, Keiko Moriya-Ito, Masao Miyazaki, Yoshihiro Wakabayashi, Takushi Kishida, Masataka Okabe, Yutaka Suzuki, Takehiko Ito, Junji Hirota, Masato Nikaido. A single pheromone receptor gene conserved across 400 million years of vertebrate evolution. Molecular Biology and Evolution, 2018; DOI: 10.1093/molbev/msy186 More.
Either there were pheromones back then or this is a classic in evolution of a structure that will be needed later (guided evolution).
See also: Homeostasis: Life’s balancing act as a challenge to unguided evolution
and
Quantum-like model of partially directed evolution?