I used R to analyze more than 500,000 e-commerce interactions from an online cosmetics dataset. I wanted to see how user activity moves from views to cart actions and purchases, and whether brands with more traffic also had better conversion rates.
- Which user actions happen most often?
- Which high-traffic brands have the highest conversion rates?
- Does getting more views actually lead to better conversion?
Views were the most common event in the data. Purchases happened much less often than views and cart-related activity.
I compared brands with at least 10,000 views so very small brands would not look unusually strong from only a few purchases. Among the brands that passed that cutoff, Milv had the highest conversion rate.
More traffic did not reliably mean a higher conversion rate.
I ran a linear regression using log-transformed views:
- R² = 0.0845
- p = 0.335
Views explained about 8.5% of the variation in conversion rates, and the relationship was not statistically significant in this analysis.
I used tidyverse to clean and summarize the event data. The analysis includes:
- filtering missing brand values
- counting views, cart actions, removals, and purchases
- calculating brand-level conversion rates
- filtering out low-traffic brands for more stable comparisons
- creating funnel and conversion charts with
ggplot2 - using linear regression to test the relationship between traffic and conversion
Ecommerce-Funnel-Analysis/
├── ecommerce_funnel_analysis.R # main analysis script
├── Cosmetic.Rmd # report source
├── Cosmetics.pdf # rendered report
├── ecommerce_funnel.png
├── top_brand_conversion.png
├── views_vs_conversion.png
└── README.md
The main analysis is in ecommerce_funnel_analysis.R. It was run in R using tidyverse, ggplot2, ggrepel, and scales.
- Higher traffic did not automatically lead to higher conversion.
- Conversion rates varied a lot even among high-traffic brands.
- View volume alone explained only a small part of the difference in conversion rates.
- The regression result was not statistically significant.
- R
- tidyverse
- ggplot2
- ggrepel
- scales
- linear regression
This is an exploratory analysis of one e-commerce dataset. The conversion rate is calculated at the brand level as purchases divided by views, so it should not be treated as a full user-level or session-level funnel.
A next step would be tracking individual users or sessions from view to cart to purchase and adding variables such as price and product category.


