Click fraud is when online ads are intentionally clicked on too many times, causing problems for businesses. This can lead to wrong click numbers and wasted money. To help businesses deal with this issue, we suggest using a machine learning algorithm called stacking. It combines different methods to find the best solution. In our study, we tried four different methods: AdaBoost, Random Forest, Decision Tree, and Logistic Regression. We also used Logistic Regression again as a second step. We tested our approach using a dataset from a big data service platform. We looked at different indicators like accuracy and score to see how well our method worked. The results showed that our stacking algorithm improved accuracy and stayed consistent. In our study, we tried four different methods: AdaBoost, Random Forest, Decision Tree, and Logistic Regression. We also used Logistic Regression again as a second step to complete the stack. We tested our approach using a dataset from a big data service platform. We looked at different indicators like to see how well our method worked. The results showed that our stacking algorithm improved accuracy and stayed consistent and stable. By using this algorithm, businesses can better detect and prevent click fraud. This helps them feel more secure when advertising online and ensures that their ad campaigns give accurate results.