Install gtag in existing HTML
site_inject_trackingIdempotently injects or refreshes the gtag snippet in every HTML file in a folder or a single file, skipping files with other measurement IDs unless replacement is enabled.
Instructions
Adds or refreshes the gtag snippet in every .html file of a folder (or a single file). Idempotent. Files that already carry another measurement ID are skipped unless replaceForeignTags=true.
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": {
"target": "<target>",
"measurementId": "<measurementId>"
},
"name": "site_inject_tracking"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | Yes | Folder or .html file. | |
| measurementId | Yes | ||
| replaceForeignTags | No |