Analytics, Search Console and your sitemap
You can't grow what you can't see. This lesson connects Mangrove Kitchen to Google Analytics and Google Search Console, publishes a sitemap so Google finds every recipe, and shows you how to read the first reports without drowning in numbers.
By the end you can
- Set up a Google Analytics property and add its tag through your agent
- Handle consent for visitors who need to give it
- Verify your domain in Search Console with a DNS record and submit a sitemap
- Read impressions, clicks, CTR and position, and pick one change a week
The everyday picture
A shopkeeper wants two kinds of facts. Inside the shop: how many people came in, which shelves they looked at, where they came from. Outside: how often the shop appears on the city map, and how many people walked over from it.
Google Analytics is the counter inside your shop. Search Console is the report from the map maker, Google Search. And a sitemap is the floor plan you hand the map maker, so no room is missed.
Google Analytics: counting visits
Google Analytics (GA4) counts visitors, pages viewed and where people came from. You create a property for the site and a web data stream for your domain, and Google gives you a Measurement ID starting with G-. The ID is public by design, so it can go in NEXT_PUBLIC_GA_ID. Your agent then adds the tag; Next.js has an official Google helper for it.
Visitors in the EEA, the UK and some other places must agree before analytics cookies are set. Google's Consent Mode lets the tag wait for the answer from a consent message. The same consent tool will handle ads in rg-04, so set it up once.
Quick check
Your agent asks whether the G- Measurement ID must be kept secret like the Supabase secret key. What do you answer?
The Measurement ID only says which property to count into; anyone can see it in the page. An environment variable still beats hard-coding, so you can change it without editing code.