🎯 Mục tiêu bài học
- Phân tích traffic source effectiveness — kênh nào mang lại nhiều khách nhất
- Tính Conversion Rate và Revenue theo từng marketing channel
- Hiểu các Attribution Models: Last-click, First-click, Linear
- So sánh ROI giữa các kênh marketing (Paid, Organic, Social, Email)
- Phân tích hành vi khách hàng theo device type và thời gian
| Thông tin | Chi tiết |
|---|---|
| ⏱️ Thời lượng | 55 phút |
| 📖 Chủ đề chính | Traffic Source, Channel ROI, Attribution, Device Analysis |
| 💡 Kiến thức cần có | Bài 01-08, SQL trung cấp |
| 🎯 Output | Marketing channel performance report cho ShopVN |
📖 Thuật ngữ quan trọng
| Thuật ngữ | Tiếng Việt | Mô tả |
|---|---|---|
| Traffic Source | Nguồn truy cập | Kênh mà khách truy cập website (Direct, Organic, Paid...) |
| Attribution | Phân bổ chuyển đổi | Xác định kênh marketing nào dẫn đến purchase |
| Last-click | Cú click cuối | Gán 100% conversion cho kênh cuối cùng trước mua |
| CAC | Customer Acquisition Cost | Chi phí để có được 1 khách hàng mới |
| ROAS | Return on Ad Spend | Revenue / Ad Spend — hiệu quả chi tiêu quảng cáo |
| Organic | Tự nhiên | Traffic từ tìm kiếm Google không trả tiền |
| Paid | Trả phí | Traffic từ quảng cáo Google Ads, Facebook Ads... |
| Social | Mạng xã hội | Traffic từ Facebook, Instagram, TikTok |
| Referral | Giới thiệu | Traffic từ website/blog khác giới thiệu |
| Bounce Rate | Tỷ lệ thoát | % sessions chỉ xem 1 trang rồi rời đi |
Checkpoint
Traffic Source cho biết khách đến từ đâu. Attribution xác định kênh nào tạo ra conversion. CAC = Marketing Spend / New Customers. ROAS = Revenue / Ad Spend — ROAS trên 3x được coi là tốt.
📊 Traffic Source Analysis
Traffic Sources trong ShopVN
Marketing Channels trên ShopVN
Traffic Performance SQL
1-- Traffic source performance: sessions, conversion, revenue2WITH source_sessions AS (3 SELECT4 traffic_source,5 COUNT(DISTINCT session_id) AS sessions,6 COUNT(DISTINCT CASE WHEN page_type = 'Product'7 THEN session_id END) AS product_views,8 COUNT(DISTINCT customer_id) AS unique_visitors,9 ROUND(AVG(duration_seconds), 1) AS avg_duration,10 ROUND(11 SUM(CASE WHEN is_bounce = 1 THEN 1 ELSE 0 END) * 100.012 / COUNT(*), 113 ) AS bounce_rate_pct14 FROM fact_page_views15 WHERE YEAR(view_date) = 202416 GROUP BY traffic_source17),18source_orders AS (19 SELECT20 traffic_source,21 COUNT(DISTINCT order_id) AS orders,22 SUM(total_amount) AS revenue,23 COUNT(DISTINCT customer_id) AS buying_customers,24 ROUND(AVG(total_amount), 0) AS aov25 FROM fact_orders26 WHERE YEAR(order_date) = 202427 AND status = 'Delivered'28 GROUP BY traffic_source29)30SELECT31 s.traffic_source,32 s.sessions,33 s.unique_visitors,34 COALESCE(o.orders, 0) AS orders,35 COALESCE(o.revenue, 0) AS revenue,36 COALESCE(o.aov, 0) AS aov,37 s.bounce_rate_pct,38 s.avg_duration,39 ROUND(COALESCE(o.orders, 0) * 100.0 / NULLIF(s.sessions, 0), 2) AS conversion_rate_pct,40 ROUND(COALESCE(o.revenue, 0) * 100.041 / NULLIF(SUM(COALESCE(o.revenue, 0)) OVER(), 0), 1) AS revenue_share_pct42FROM source_sessions s43LEFT JOIN source_orders o ON s.traffic_source = o.traffic_source44ORDER BY revenue DESC;Channel Performance Benchmark
| Channel | Sessions Share | Conv Rate | AOV | Bounce Rate |
|---|---|---|---|---|
| Direct | 20-25% | 5-8% | Cao | 25-35% |
| Organic | 20-25% | 4-6% | TB-Cao | 30-40% |
| Paid | 20-30% | 3-5% | TB | 35-45% |
| Social | 15-20% | 1-3% | Thấp-TB | 45-60% |
| 3-5% | 6-10% | Cao | 20-30% | |
| Affiliate | 5-10% | 3-5% | TB | 35-45% |
| Referral | 5-10% | 3-5% | TB | 30-40% |
🎯 Attribution Models
Các mô hình phân bổ
Attribution Models phổ biến
| Model | Mô tả | Ưu điểm | Nhược điểm |
|---|---|---|---|
| Last-click | 100% credit cho touchpoint cuối | Đơn giản, dễ implement | Bỏ qua awareness channels |
| First-click | 100% credit cho touchpoint đầu | Đánh giá đúng awareness | Bỏ qua closing channels |
| Linear | Credit chia đều cho tất cả touchpoints | Công bằng | Không phân biệt impact |
| Time Decay | Touchpoint gần purchase được credit nhiều hơn | Realistic | Phức tạp hơn |
Trong dataset ShopVN, traffic_source trên fact_orders là last-click attribution — kênh cuối cùng trước khi đặt hàng. Đây là mô hình phổ biến nhất tại Việt Nam vì đơn giản và dễ đo lường.
Last-click Attribution trên ShopVN
1-- Last-click Attribution: revenue và orders theo source2SELECT3 traffic_source,4 COUNT(DISTINCT order_id) AS orders,5 SUM(total_amount) AS revenue,6 ROUND(AVG(total_amount), 0) AS aov,7 COUNT(DISTINCT customer_id) AS unique_buyers,8 ROUND(9 SUM(total_amount) * 100.0 / SUM(SUM(total_amount)) OVER(), 110 ) AS revenue_attribution_pct11FROM fact_orders12WHERE status = 'Delivered'13 AND YEAR(order_date) = 202414GROUP BY traffic_source15ORDER BY revenue DESC;Checkpoint
Last-click Attribution gán 100% credit cho kênh cuối cùng trước purchase. Nó đơn giản nhưng đánh giá thấp awareness channels (Social, Display). Email và Direct thường có conversion rate cao nhất vì target khách đã biết brand.
📱 Device & Time Analysis
Hành vi theo Device
1-- Performance theo device type2SELECT3 o.device_type,4 COUNT(DISTINCT o.order_id) AS orders,5 SUM(o.total_amount) AS revenue,6 ROUND(AVG(o.total_amount), 0) AS aov,7 ROUND(8 COUNT(DISTINCT o.order_id) * 100.09 / SUM(COUNT(DISTINCT o.order_id)) OVER(), 110 ) AS order_share_pct11FROM fact_orders o12WHERE o.status = 'Delivered'13 AND YEAR(o.order_date) = 202414GROUP BY o.device_type15ORDER BY orders DESC;Hành vi theo ngày trong tuần
1-- Orders theo ngày trong tuần2SELECT3 t.day_name,4 t.day_of_week,5 COUNT(DISTINCT o.order_id) AS avg_daily_orders,6 ROUND(AVG(o.total_amount), 0) AS aov,7 ROUND(SUM(o.total_amount) / COUNT(DISTINCT t.date_key), 0) AS avg_daily_revenue8FROM fact_orders o9JOIN dim_time t ON o.order_date = t.date_key10WHERE o.status = 'Delivered'11 AND t.year = 202412GROUP BY t.day_name, t.day_of_week13ORDER BY t.day_of_week;Seasonality: Doanh số theo tháng
1-- Monthly revenue trend + YoY comparison2SELECT3 t.month,4 t.month_name,5 SUM(CASE WHEN t.year = 2024 THEN o.total_amount ELSE 0 END) AS revenue_2024,6 SUM(CASE WHEN t.year = 2023 THEN o.total_amount ELSE 0 END) AS revenue_2023,7 ROUND(8 (SUM(CASE WHEN t.year = 2024 THEN o.total_amount ELSE 0 END)9 - SUM(CASE WHEN t.year = 2023 THEN o.total_amount ELSE 0 END))10 * 100.011 / NULLIF(SUM(CASE WHEN t.year = 2023 THEN o.total_amount ELSE 0 END), 0)12 , 1) AS yoy_growth_pct13FROM fact_orders o14JOIN dim_time t ON o.order_date = t.date_key15WHERE o.status = 'Delivered'16GROUP BY t.month, t.month_name17ORDER BY t.month;Doanh số cao nhất vào:
- 📅 Tháng 11: Flash Sale 11.11 (Singles Day)
- 📅 Tháng 12: Flash Sale 12.12 + Giáng sinh
- 📅 Tháng 1-2: Tết Nguyên Đán
- 📅 Tháng 6: Mid-year Sale 6.6
Doanh số thấp nhất: Tháng 3-4 (sau Tết, không có event lớn). DA cần adjust for seasonality khi so sánh MoM.
📋 Tổng kết
Kiến thức đã học
| Chủ đề | Nội dung chính |
|---|---|
| Traffic Sources | 7 channels: Direct, Organic, Paid, Social, Email, Affiliate, Referral |
| Channel Performance | Sessions, Conversion Rate, Revenue, AOV theo từng channel |
| Attribution Models | Last-click (đơn giản) vs First-click vs Linear vs Time Decay |
| Device Analysis | Mobile chiếm 70%+ traffic, Desktop conversion cao hơn |
| Seasonality | 11.11, 12.12, Tết là peak periods |
Key Takeaways
- ✅ Email có conversion cao nhất (6-10%) nhưng volume thấp — tăng email list
- ✅ Social có bounce rate cao nhất (45-60%) — cải thiện landing page
- ✅ Mobile chiếm 70%+ traffic nhưng conversion thấp — optimize mobile UX
- ✅ Seasonality mạnh — plan inventory và marketing budget theo mùa
Bài tiếp theo: Review & Sentiment Analysis →
🎉 Bạn đã hiểu Marketing Attribution! Module tiếp theo sẽ phân tích reviews và xây dựng dashboards.
