The analysis can detect the presence of a long list of illicit drugs, from methamphetamine to Ecstasy and other markers of human presence such as caffeine and cotinine, a break-down product of nicotine from cigarette smoke. Although wastewater is often tested for contaminants after it is treated as a measure of potential environmental impact, this new approach tests sewage as it enters a wastewater treatment plant, before it is treated, to get a profile of the drugs being used in the community.