Why Analytics Matters From Day One
You cannot improve what you cannot measure. Adding Google Analytics before you drive any traffic means you will have data from the first visitor -- who they are, where they came from, what page they landed on, how long they stayed. This data makes every future marketing decision more accurate.
The most important metric to watch on a new landing page: bounce rate by traffic source. If visitors from one source are leaving immediately and visitors from another are staying, that tells you where to focus your traffic efforts.
Step 1: Create a GA4 Property
Go to analytics.google.com. Create a new property for your site. Choose Web as the platform. Enter your Replit app URL. GA4 will generate a Measurement ID that looks like G-XXXXXXXXXX. Copy this.
Step 2: Ask Claude to Add the Script
Prompt: "Add Google Analytics 4 tracking to my Replit Express app. My Measurement ID is [G-XXXXXXXXXX]. Add the GA4 tracking script to every page so all page views are tracked automatically."
For Express apps, Claude will add it to the HTML layout or template that wraps all pages -- this way it appears on every route without adding it manually to each page.
Step 3: Verify It Is Working
After deploying, open your site in a browser, then check the Realtime report in Google Analytics. If your visit appears, tracking is working. If not, ask Claude to check the implementation -- usually the script is in the wrong location or the Measurement ID has a typo.