bootstrap_site_measurement
Plan or apply a website's GA4 and Search Console measurement setup: detect existing assets, create only missing properties, streams, key events, dimensions, then report IDs and verification tokens.
Instructions
Plan, and optionally apply, the full measurement setup of a website.
With apply=False (default) nothing is changed: it detects what already exists for the site (GA4 property and web stream matched by the site's domain, key events, custom dimensions, Search Console domain property) and returns the steps that would run. Show this plan to the user and get explicit confirmation before calling apply=True.
With apply=True (requires the server to run with --enable-writes) it creates only the missing pieces, skipping what exists, so it is safe to re-run. It returns a step-by-step report with the GA4 measurement ID (G-...) and the DNS TXT token for Search Console. DNS verification and sitemap submission stay manual follow-up steps (sc_verify_site_dns, sc_submit_sitemap) because the TXT record must be published first.
Args: site_url: the site, e.g. 'https://example.com'. account_id: GA4 account that owns (or will own) the property; see list_account_summaries. property_display_name: name for a new property; also used to find an existing one. time_zone: IANA time zone for a new property, e.g. 'America/Mexico_City'. currency_code: ISO 4217 currency for a new property, e.g. 'USD'. key_events: event names to mark as key events, e.g. ['generate_lead']. custom_dimensions: parameters to register as custom dimensions. apply: False = plan only (default); True = execute the plan.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apply | No | ||
| site_url | Yes | ||
| time_zone | Yes | ||
| account_id | Yes | ||
| key_events | No | ||
| currency_code | Yes | ||
| custom_dimensions | No | ||
| property_display_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||