Capillary electrophoresis-mass spectrometry (CE-MS) is gaining interest for metabolomics studies because of its high separation efficiency, selectivity, and versatility. The ability to inject nanoliters from only a few microliters of sample in the injection vial makes this approach very suited for volume-limited applications. However, the low injection volumes could compromise the detection sensitivity of CE-MS, thereby potentially limiting its scope in metabolomics. To overcome this issue, online sample preconcentration methods have been developed to increase sample-loading volumes without hampering the intrinsic high separation efficiency of CE. In this protocol, online preconcentration with sample stacking based on pH junction was assessed for the direct profiling of endogenous metabolites in rat brain microdialysates. Sample stacking was realized by a pre-injection of ammonium hydroxide, followed by a large sample injection (i.e., about 17% of the total capillary volume). It is shown that this relatively simple and fast preconcentration procedure is fully compatible with the high-salt concentration in microdialysates and significantly improves the detection sensitivity of the CE-MS method.