Optimize an existing Google tag snippet
optimize-google-tagRebuild GA4 gtag.js markup from a G- measurement ID. Use on existing GA4 snippets, not GTM containers or consent setup. Returns replacement HTML with async loading and a config call, or original input if no G- ID exists. Review lost settings and consent.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"html": "<html>"
},
"name": "optimize-google-tag"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| html | Yes | Existing HTML snippet containing the Google Analytics tag to optimize. |