In this project, we analyze the results of an A/B test conducted for a marketing campaign. The goal is to determine whether showing ads resulted in more conversions compared to a Public Service Announcement (PSA) and evaluate how much of the campaign's success can be attributed specifically to the ads.
We will also investigate user behavior patterns, including the best days and times to show ads, and assess the statistical significance of our findings through hypothesis testing.
- Determine Campaign Success: Analyze whether the ads increased conversion rates compared to the PSA group.
- Statistical Significance: Assess if the differences between the ad and PSA groups are statistically significant.
- Lift Calculation: Measure how much of the success can be attributed to the ads by calculating the lift in conversions.
- User Behavior Insights: Identify the days and times when conversion rates peak to guide future ad placements.
- Marketing Strategy: Provide actionable strategies based on the findings to optimize future ad campaigns.
- user id: Unique identifier for each user.
- test group: Specifies whether a person saw an advertisement (
ad
) or a public service announcement (psa
). - converted: Indicates whether the person purchased the product (True) or not (False).
- total ads: Number of ads seen by the person.
- most ads day: Day of the week when the person saw the most ads.
- most ads hour: Hour of the day when the person saw the most ads.
We started by cleaning the dataset, handling missing values, and transforming the data to prepare it for analysis.
We conducted an exploratory analysis to understand the general trends in the dataset, focusing on the distribution of ads seen, conversion rates across the test group (ad
vs. psa
), and patterns of user behavior.
We calculated the conversion rates for both groups:
- Ad Conversion Rate = (Number of conversions in the
ad
group) / (Total users in thead
group) - PSA Conversion Rate = (Number of conversions in the
psa
group) / (Total users in thepsa
group)
This helped us understand whether showing ads was more effective than showing PSAs in driving conversions.
To determine whether the difference in conversion rates between the ad group and PSA group was statistically significant, we used the Z-test for proportions. This test compares the conversion rates of both groups.
Where:
-
$' p_{ad} '$ = Conversion rate of the ad group. -
$' p_{psa}'$ = Conversion rate of the PSA group. -
$' p_{combined}'$ = Combined conversion rate of both groups. -
$' n_{ad}'$ = Number of users in the ad group. -
$' n_{psa}'$ = Number of users in the PSA group.
We then used the p-value corresponding to the Z-statistic to check for statistical significance.
To further understand the relationship between seeing ads and conversions, we performed a Chi-Square test for independence. This test helped us determine whether the probability of conversion was dependent on whether the user saw an ad or a PSA.
Where:
-
$' O'$ = Observed frequency (actual conversions in each group). -
$' E'$ = Expected frequency (based on overall conversion rate).
We created a new feature combining most ads day
and most ads hour
to analyze conversion rates by day and time.
data['day and hour'] = data['most ads day'].astype(str) + '_' + data['most ads hour'].astype(str)
We then analyzed conversion rates by these combinations, allowing us to identify specific days and times when ads were most effective.
Lift quantifies how much of the campaign's success is attributable to the ads. We calculated the lift to measure the incremental increase in conversions due to the ads compared to the PSA group.
Where:
-
$' p_{ad}'$ = Conversion rate of the ad group. -
$' p_{psa}'$ = Conversion rate of the PSA group.
After thorough analysis, we found that the marketing campaign utilizing ads significantly outperformed the PSA strategy in driving conversions. The statistical tests indicated a significant difference in conversion rates, validating the effectiveness of the ads.
Additionally, the analysis of day and time combinations revealed that certain times, such as Saturday at 5 AM and 6 AM, showed peak conversion rates. This insight into user behavior suggests that these timings could be optimal for future advertising strategies.
In summary, our findings confirm that ads effectively enhanced the conversion rate, and we gained actionable insights to inform future marketing efforts.
Based on the analysis, the following strategies are recommended for future campaigns:
- Targeted Advertising: Focus on time slots where conversion rates are highest, particularly on weekends.
- Enhanced Weekend Campaigns: Allocate more resources to ads on Saturday mornings, where engagement is notably higher.
- Continuous Monitoring: Regularly analyze user behavior patterns to adapt ad placements in real-time.
- Segmented Campaigns: Tailor campaigns to specific user segments based on their interaction with ads to maximize conversion rates.