Using the first-principles calculation, based on density functional theory, the geometric structures, electronic, magnetic, and optical properties of CO, H2S, and NO toxic gas molecules adsorbed on alkali metals (Li, Na, K, Rb, and Cs) doped g-GaN monolayer have been investigated. The adsorbed systems have induced magnetic property except H2S adsorbed on Na doped g-GaN monolayer, the total magnetic moment of CO, H2S, and NO adsorbed on alkali metals doped g-GaN are 2.0, 2.0, and 1.0 μB, respectively, and the materials are spin semiconductors. The charge transfer mainly occurs between gas molecules, doped atoms, and Ga atoms. The adsorbed behaviors of CO, H2S, and NO adsorbed on intrinsic g-GaN are physisorption, H2S adsorbed on Na doped g-GaN monolayer and NO adsorbed on Li, Na, K, Rb, and Cs doped g-GaN monolayer are chemisorption, while CO adsorbed on alkali metals doped g-GaN monolayer are physisorption. The results show that the adsorptive properties can be enhanced dramatically by doping with alkali metals, and the materials can be used in gas sensor devices and detector devices. In addition, the adsorbed coefficients in ultraviolet and visible indicate the materials promising the application of violet and UV optoelectronic devices.