Environmental conditions affect the distribution and quality of Chinese herbal medicines. Specific ecological conditions influence the formation and accumulation of the active ingredient of these medicines, therefore an appropriate ecological environment is a prerequisite for production of high-quality genuine medicinal materials. Ginseng is a valuable Chinese herbal medicine. Ginsenoside content is the main indicator used for evaluation of ginseng quality. This study aimed to explore the impact of ecological factors on ginsenoside accumulation to enhance the quality of ginseng. The data was analyzed with multiple statistical analytic methods. Root samples were collected from five-year-old cultivated panax ginseng plants in the major genuine (Daodi) ginseng-producing areas of Jilin, Liaoning, and Heilongjiang provinces, China. Soil samples from the sampling sites were collected. Ultra-performance liquid chromatography was used to analyze the contents of nine ginsenosides (Rg1, Re, Rf, Rg2, Rb1, Rc, Rb2, Rb3, and Rd). Data for 10 ecological factors, including temperature, moisture, and sunlight, were obtained from the ecological database of Geographic Information System for Traditional Chinese Medicine. Effective boron, effective iron and other trace elements as well as available nitrogen, available potassium and other soil nutrients were determined by conventional soil physicochemical property assay methods. Canonical correlation analysis between ginsenosides contents and soil nutrients showed that soil available boron, effective iron, and available nitrogen were significantly positively related to ginsenosides contents. Thus, increased quantities of soil available boron, effective iron and available nitrogen could promote the accumulation of ginsenosides. In addition, a significant positive correlation existed between soil moisture and ginsenosides contents (Rb3 excluded), and a weak correlation was obtained between available phosphorus, pH, quick zinc and ginsenosides contents. The correlation between ginsenosides contents and climatic factors (annual active accumulated temperature, annual mean temperature, July maximum temperature, July mean temperature, January minimum temperature, and January mean temperature) was strongly negative in this study. In particular, there existed a significant negative correlation (r>0.6) between climatic factors and the ginsenosides Rg1, Re and Rb1, which were specified in the pharmacopoeia. These results implied that ginsenosides contents increased with decreasing temperature within a certain temperature range; an appropriate low temperature was conducive to the accumulation of the ginsenosides, and elevation was significantly positively related to the contents of Rc, Rb2, and Rb3 (r > 0. 6). In other words, a relatively high elevation could promote the accumulation of these three components. However, the results showed average annual precipitation, relative humidity, annual average sunshine hours were not significantly correlated with ginsenosides contents in this study. In conclusion, principal component analysis, canonical correlation analysis and ordination were applied to investigate the correlation between ecological factors and ginsenosides contents of cultivated ginseng collected from three ginseng-producing areas. The results indicated temperature factors play a decisive role in the accumulation of ginsenosides. Within a certain temperature range, the lower the temperature the more beneficial was the accumulation of ginsenosides; in addition, the levels of available boron, effective iron and available nitrogen in the soil were positively correlated to ginsenosides contents. These results indicated an appropriate low temperature and enhancement of boron, iron, and nitrogen in the soil could improve the ginsenosides contents in cultivated ginseng.