Data on online advertising is rising rapidly due to the fast development of science and technology. Click-through rate (CTR) prediction has become a critical task regarding the digital advertising industry and a key element in increasing advertising profits and user experience. Therefore, this article describes the problem of CTR prediction as a function of sequence classification tasks. Then, we proposed a novel optimization strategy to solve the high-dimensional problem and find a subset of relevant variables to ensure high performance of our model and maximize the number of clicks. Here, we introduced a feature selection and hyper-parameter optimization approach using genetic algorithms (GA) and the upper confidence bound (UCB) model to optimize micro-targeting technology, along with the long short-term memory (LSTM) network-based CTR prediction model. The efficiency of the proposed UCB-LSTM-GA model and two hybrid models, namely LSTM-GA and LSTM-PSO, is evaluated by comparing them to each other and to other machine-learning-based classification methods, including LSTM using a UCB algorithm (UCB-LSTM), High-order Attentive Factorization Machine (HoAFM), genetic algorithm-artificial neural network (GA-ANN), and a feature interaction graph neural network model (Fi-GNN). Our solution achieved as high as 87%, 89%, and 92% for respectively accuracy, precision, and recall, using the popular python tools with real Avazu datasets.