Web Analytics
Web Analytics
Web Analytics tests how Mixpanel captures and interprets browser behavior: pageviews, sessions, campaign attribution, identity, and SDK configuration. Expect questions on implementation choices that change what data arrives, not just report reading.
Core rules
- The JavaScript SDK initializes with a project token.
track_pageviewcan send$pageviewautomatically; manualtrackis still needed for business events such asSignup Completed. - Autocapture can record clicks and form interactions, but named product events remain the reliable basis for funnels and retention.
- UTM parameters,
$referrer, and$current_urlarrive on pageviews. Persist campaign values as super properties or profile properties if later events need attribution. - The SDK stores an anonymous
distinct_idin a cookie or local storage. Callidentifyat login or signup so pre-login and post-login activity join correctly. - Cross-domain tracking depends on cookie configuration; a new domain can create a new anonymous ID unless identity is passed or the cookie is shared.
- Consent choices affect whether the SDK can set identifiers or send events; blocking scripts means no data, not delayed data.
Worked example
A campaign lands on ?utm_source=newsletter&utm_campaign=spring. The first $pageview records those values. The visitor then signs up. If UTM values are only on the landing pageview, the Signup Completed event has no campaign context. Register utm_source and utm_campaign as super properties after the first pageview, then build a funnel from $pageview to Signup Completed and break down by utm_campaign. The reasoning: attribution must travel with the user, not stay attached to one page event.
Traps
Double-counting pageviews when both autocapture and manual tracking fire; losing UTMs after the landing page; identifying only after signup; assuming ad blockers and consent banners do not affect volumes; and comparing campaign groups without checking landing-page differences.