Glyphosate is one of the most widely used pesticides as it is a non-selective systemic herbicide that is quickly degrade in soil. Glyphosate disrupts the biochemical shikimate pathway, which produces aromatic amino acids that are essential for plant growth and development. It acts as a competitive inhibitor of the 5-enolpyruvylshikimate-3-phosphate (EPSP) synthase, an enzyme absent from mammals. Therefore, glyphosate has been presented as (a) non-toxic for humans and (b) non-persistent. However, these premises have been recently questioned since traces of glyphosate and its main metabolite (aminomethylphosphonic acid, AMPA) have been detected in surface water, groundwater, soil as well as in cotton products. Quantifying and monitoring trace amounts of glyphosate and pesticide residues in the environment typically relies on analytical methods such as Gas Chromatography (GC) or Liquid Chromatography (LC) coupled with mass spectrometry (MS). However, these types of methods are expensive and often not suitable for in situ field analysis. Surface Enhanced Raman Spectroscopy (SERS) coupled with microfluidic could be an alternative method, which allows a fast and direct quantification on the field with miniaturised instrumentation. Indeed, SERS combines the advantage of Raman spectroscopy and is able to detect traces due to the signal enhancement resulting from the adsorption of the analyte on the rough nanoparticle surface. Here we focus on the development of an inline analytical method for water monitoring assisted by SERS. The inline detection of glyphosate is performed in a microfluidic setup, constructed with high-purity PFA coils (1/16" o.d., 0.01" i.d.), divided in three compartments (Figure 1) : (a) in situ synthesis of silver nanoparticles (Ag NPs), (b) mixing of the analyte with the Ag NPs and (c) the detection zone. Experimental parameters such as the type of micromixers for the synthesis of Ag NPs and the mixing between glyphosate and Ag NPs, the concentration of reagents for the synthesis of Ag NPs, the residence time or the flow applied in the setup were investigated and optimized through D-optimal (26 runs) and I-optimal design of experiments. In particular, we will discuss how the experimental parameters influence the quantitative detection of SERS intensity.