The present disclosure describes methods and systems for detecting a tracer in a hydrocarbon reservoir. One method includes injecting a tracer at a first location in a reservoir, wherein the tracer mixes with subsurface fluid in the reservoir; collecting fluid samples at a second location in the reservoir; mixing a magnetic surface-enhanced Raman scattering (SERS) particle with the fluid samples; applying a magnetic field to the mixed fluid samples; and analyzing the fluid samples to detect a presence of the tracer in the fluid samples.