The electronic nose is an advanced technology that emulates the human olfactory system, aiming to simulate and interpret odors and gas components. With the increasing demand for gas analysis in industries, the environment, and medical fields, the electronic nose has garnered widespread attention as a fast, convenient, and efficient gas identification tool. However, accurate gas-type discrimination and concentration prediction have remained challenging in electronic nose research due to the complexity and diversity of gas samples. Therefore, we proposed an innovative multitask learning approach, gated recurrent unit (GRU)-convolutional neural network (CNN)-MTL, combining a GRU and a 1-D CNN for gas-type discrimination and concentration prediction tasks. Attention mechanisms were separately integrated into GRU and 1-D CNN, allowing the model to automatically learn and focus on critical features relevant to the studies, thereby enhancing discrimination and prediction accuracy. Additionally, Bayesian optimization algorithms were employed to discover the optimal hyperparameter combinations, further optimizing the model’s performance. Experiments were conducted on two publicly available datasets, demonstrating outstanding performance with 99.84% accuracy and 97.57% ${R}^{{2}}$ achieved on the first dataset and 99.92% accuracy and 99.97% ${R}^{{2}}$ performed on the second dataset. These results further validated the potential application of our proposed method in the field of gas analysis and provided valuable insights for future research.