---
name: set-up-search-console-and-ga4
description: "Verify the domain, submit the sitemap and add a GA4 stream, all by API."
---

# Set up Search Console and GA4

Purpose:: Google can find, index and measure the site.

Rules::
- Use the official APIs; never fake ownership
- Verify by DNS TXT record on the domain
- Tokens never printed

Inventory::
- Search Console and Site Verification APIs, GA4 Admin API, your registrar's DNS API

Steps::
1. Get a verification token; add it as a TXT record; verify the domain property
2. Submit https://<domain>/sitemap.xml
3. Create a GA4 property and web stream; copy the G- id
4. Add the gtag to the site's root layout, loaded after the page is interactive
5. Deploy; reply in one line: verified, sitemap submitted, GA4 id

Metrics::
- Search Console shows the sitemap as read
- The live HTML has the gtag and GA4 shows a visit

Source:: https://isklls.com/skills/set-up-search-console-and-ga4 (iSklls, free skill library)
