The traditional marketing model can no longer meet the needs of users and can not add more benefits to the enterprise, and digital marketing came into being. At present, most of the marketing focus of various enterprises is still mainly on products, and the reflection arc to market changes is long. Therefore, the formulation of marketing activities should always pay attention to changes in user needs and combine corresponding activity planning, product planning, brand building, etc., according to Changes in the target market adjust the content of marketing activities and products in real-time and, at the same time, pay attention to user feedback on products in order to iteratively update products in time, improve product market competitiveness, and optimize the user experience. In this paper, through the study and research of the traditional random forest method and some data processing algorithms, the feature selection and class imbalance problems of random forest are improved, respectively. Through the study of feature selection methods, we can maintain a balance between feature strength and relevance during feature selection and improve the final model classification effect. And through the research and experiment of the imbalanced data classification problem and the random forest algorithm, the method of the random forest model to deal with the imbalanced problem has been improved. After experimental calculation and analysis, it is found that for the effect of the minimum number of samples required for node splitting with different numbers, the best results are obtained when 2 samples are taken as the minimum number of samples required for node splitting, and the average value of the F1 evaluation is 0.1038; for different specifications, the effect of the random forest is the best using the Gini index, and the average value of its F1 evaluation is 0.1033; for the effect analysis of random forests with different numbers of trees, 7 to 10 decision trees are the best, and the F1 evaluation is the best. The average is 0.10175.