Investigate a Sudden Traffic Surge and Conversion Drop
Statistics & ExperimentsModel answerLast updated
Diagnose a May spike in weekly sessions paired with a falling conversion rate using segmentation, time-series comparison, and data quality checks on a week-level dataset.
Investigate a Sudden Traffic Surge and Conversion Drop
You work as a data scientist at an e-commerce platform. Your weekly metrics dashboard covers the past three years. While reviewing it, you notice that sometime around May of the most recent year:
- Weekly session count spikes sharply upward.
- Conversion rate (orders ÷ sessions) drops sharply at the same time.
- A third engagement metric — such as average session duration, bounce rate, or orders per session — also shifts noticeably.
You pull week-level data to investigate. The dataset includes the following fields:
| Field | Description |
|---|---|
year_week | Year-week label, stored as a string (e.g., "2024-5", "2024-W05") |
week_start_date | Calendar date of the week's Monday, when present |
sessions | Total sessions recorded that week |
orders | Conversions or orders placed that week |
conversion_rate | Pre-computed orders / sessions |
shop_type | Merchant or product category |
session_duration_bucket | Duration band: 0, 0-30 seconds, 30-60 seconds, 60+ |
Your tasks:
- Generate hypotheses for why weekly sessions spiked around May.
- Explain why conversion rate could fall at the exact same time sessions spike.
- Describe a step-by-step investigation plan using the week-level data. Include how you would handle the
year_weekdata quality issue. - Your analysis reveals that the session spike is concentrated in specific shop types and almost entirely within the
0and0-30 secondsduration buckets. Interpret this finding and recommend concrete next steps.
For each task, state your reasoning clearly. Where relevant, mention what you would verify before drawing conclusions.
Hints
Hint 1
Conversion rate is a ratio — think about what happens to orders/sessions when a large batch of sessions arrives that never buy anything. Plot absolute orders alongside the rate before concluding that revenue was hurt.
Hint 2
A string label like '2024-5' sorts differently from '2024-05' in lexicographic order. Think about what mis-sorted or mis-parsed week labels could do to a time-series chart, and how ISO week numbering near year boundaries adds another wrinkle.
Hint 3
When you find that incremental sessions cluster in near-zero-duration buckets for specific shop types, ask what legitimate user behavior looks like in those buckets versus what bot or tracking-artifact behavior looks like.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
Approach
This question tests whether you treat a dashboard anomaly as something to diagnose rather than report. The strong answer does four things: generates hypotheses across multiple categories, recognizes that conversion rate is a ratio whose denominator matters, fixes the data before analyzing it, and turns a segment finding into an actionable recommendation.
1. Hypotheses for the Session Spike
Group hypotheses into categories so your reasoning looks systematic rather than random.
Genuine demand
- Seasonality. Mother's Day, Memorial Day, and spring promotions all fall in May. A recurring seasonal pattern should appear in prior years at the same ISO weeks, though perhaps at lower magnitude.
- Marketing activity. A paid campaign, email blast, influencer partnership, or new affiliate channel could drive a surge in a single week.
- Merchant onboarding. A wave of new shops going live, or a large merchant migrating onto the platform, would add sessions without an established buyer base yet.
Low-quality or non-human traffic
- Bot and crawler activity. Price scrapers, inventory crawlers, AI training crawlers, or credential-stuffing scripts all register as sessions.
- Click fraud. Fraudulent clicks on paid ads inflate session counts without any purchase intent.
- Link prefetching. Some social and messaging apps preload URLs, which can register as sessions.
Tracking or instrumentation changes
- SDK or theme release. A new analytics library or storefront theme can fire duplicate pageview events or split a single visit into multiple sessions.
- Session definition change. Shortening the inactivity timeout or changing how cross-subdomain traffic is handled inflates session counts without changing real visits.
- Consent banner change. Altering cookie consent logic can suddenly include or exclude large user cohorts.
Pipeline or reporting artifact
- Duplicate rows. A backfill or double-load would inflate counts.
- Week mis-bucketing. Incorrect parsing of
year_week(see section 3) can collapse two weeks into one label or assign sessions to the wrong week.
2. Why Conversion Rate Falls When Sessions Spike
Conversion rate is CR = orders / sessions. Sessions can spike while CR falls for three distinct reasons, and distinguishing them matters.
Denominator inflation with flat orders. Extra sessions arrive that never buy anything, and absolute orders stay roughly flat. CR falls mechanically. This is not a revenue problem — it is a traffic quality problem. Always plot absolute orders alongside the rate. If orders are flat, there is no lost revenue to explain.
Mix shift (Simpson's paradox). Overall CR is a weighted average across segments:
CR = Σᵢ wᵢ · CRᵢ
where wᵢ = sessionsᵢ / total_sessions. If a low-intent segment grows its share wᵢ while every individual segment's rate CRᵢ stays constant, the overall rate falls. No segment got worse; the composition of traffic changed.
A real conversion problem that happens to coincide. A checkout bug, payment outage, or pricing change could suppress orders within stable segments at the same time. In this case, absolute orders drop too, and the within-segment rate falls.
The third engagement metric distinguishes these: if bounce rate rises and session duration collapses, the extra sessions are junk. If duration is normal but orders per session drop within existing segments, there is a funnel problem worth fixing.
3. Investigation Plan
Step 1: Fix the time key.
String labels like "2024-5" and "2024-05" sort differently. "2024-9" sorts after "2024-12" lexicographically. Near the year boundary, ISO week 1 of 2025 can fall in late December 2024, meaning the ISO year differs from the calendar year. Week 53 exists in some years but not others. Partial first and last weeks of the dataset are also common.
Fix: use week_start_date as the primary key when it is present and complete. Otherwise, parse year_week by extracting the four-digit year and one-or-two-digit week number, then construct an explicit ISO Monday date:
import pandas as pd
import re
def parse_week_key(df):
df = df.copy()
if "week_start_date" in df.columns and df["week_start_date"].notna().all():
df["week"] = pd.to_datetime(df["week_start_date"])
else:
# handles "2024-5", "2024-05", "2024-W5", "2024W05"
extracted = df["year_week"].astype(str).str.extract(r"(\d{4})\D*W?(\d{1,2})")
df["week"] = pd.to_datetime(
extracted[0] + "-W" + extracted[1].str.zfill(2) + "-1",
format="%G-W%V-%u"
)
# sanity checks
assert df["week"].notna().all(), "Some weeks failed to parse"
gaps = df["week"].sort_values().diff().dropna()
assert (gaps == pd.Timedelta("7 days")).all(), "Non-7-day gaps detected"
return df
After parsing, verify that the week sequence is contiguous and that each segment combination appears exactly once per week.
Step 2: Recompute metrics from raw counts.
Never average the pre-computed conversion_rate column across rows — it weights a week with 100 sessions the same as one with 10,000. Always compute sum(orders) / sum(sessions).
Step 3: Year-over-year comparison.
Compare the spike ISO weeks against the same ISO weeks in both prior years. A seasonal effect recurs every year. A one-off spike points to a campaign, bot wave, or instrumentation change.
Step 4: Decompose the CR change into mix and rate effects.
For a baseline window (e.g., the 6 weeks before the spike) and the spike weeks, compute per-segment sessions, orders, CR, and weight. Then:
- Mix effect per segment:
(w_spike − w_base) × CR_base - Rate effect per segment:
w_spike × (CR_spike − CR_base)
Summed across segments, these two effects should add up to the total observed change in CR. This tells you whether the drop is structural (rate effect) or compositional (mix effect).
Step 5: Sanity checks. Segment totals should reconcile to dashboard totals. The decomposition components should sum correctly. If they do not, there is still a data issue.
4. Interpreting the Segment Finding
Finding: the session spike is concentrated in specific shop types and almost entirely in the 0 and 0-30 seconds duration buckets.
What it means. Near-zero-duration sessions represent visits where the user bounced immediately or where no real browsing occurred. When the spike lives almost exclusively in those buckets, the incremental sessions carry essentially no purchase intent. Absolute orders will be flat or near-flat for those segments. The conversion rate drop is therefore a mix effect from denominator inflation, not a signal that real buyers are converting less.
Before stating this as a conclusion, verify it: exclude the 0 and 0-30 seconds buckets and recompute overall CR for the spike period. If it returns to baseline, the hypothesis is confirmed. State that you would run this check.
Likely root causes, in rough order of probability:
- Bot or scraper traffic targeting those specific shop types — common for high-value catalogs or category pages with structured data.
- A tracking artifact in a recent SDK or theme change deployed to those shop types.
- Click fraud on paid campaigns running against those categories.
Recommended next steps:
- Filter the
0and0-30 secondsbuckets out of conversion reporting as a short-term mitigation, so the business dashboard reflects real buyer behavior. - Pull IP-level or user-agent data for the spike period to distinguish bots from prefetch traffic.
- Check whether a tracking release or session definition change was deployed to the affected shop types around May.
- If bots are confirmed, engage the platform's fraud or trust-and-safety team and evaluate bot-filtering at the edge (e.g., rate limiting, CAPTCHAs, or IP blocklists).
- Monitor absolute orders independently of session counts going forward, so a future traffic quality issue does not obscure or mimic a real revenue problem.
Common Mistakes
- Concluding revenue was hurt before checking whether absolute orders changed.
- Averaging the
conversion_ratecolumn directly instead of recomputing from sums. - Ignoring the
year_weekparsing issue and trusting lexicographic sort order. - Listing only one or two hypotheses rather than working through categories systematically.
- Presenting the segment finding as the final answer without saying you would verify it by re-running CR with those buckets excluded.