Skip to main content
Glama

Opus Growth, Ad Platforms MCP Connector

Set WordPress Tracking Tags

wordpress_set_tracking
Destructive

Set a WordPress site's Google Tag Manager or GA4 measurement id, add code to the site header, or switch off an old tracking snippet.

gtm_id goes into the GTM4WP plugin when that plugin is active, otherwise the connector emits the tag itself, so this works with or without a tag plugin.

remove_id takes a measurement id like "GTM-5H2L5V63" or "AW-851563016" and removes it wherever it lives — a plugin setting, a header/footer box, or a WPCode snippet (that one is switched off, not deleted). This is how you stop a site double-counting after a container change. If the id is hard-coded in a theme PHP file it is reported back under skipped with the file and line; that copy can now be removed with wordpress_theme_file(mode="remove_block", contains=""), which backs the file up and reverts automatically if the edit breaks PHP. head_code="" clears the header code the connector emits.

To change a few words inside the connector's existing header/footer code (an address in a JSON-LD block, a phone number) without resending the whole block, pass replace=[{"find":"old text","with":"new text"}] and replace_in="head" (default) or "body". The current code is read from the site, each find must match exactly (case-sensitive), and confirm=false PREVIEWS how many times each one matches and writes NOTHING; confirm=true applies and re-reads the code to verify. A find whose replacement is already in place is reported as already_applied and skipped, so repeating the call is safe.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ga4_idNo
gtm_idNo
confirmNo
replaceNo
site_urlNo
body_codeNo
head_codeNo
remove_idNo
replace_inNohead
enable_snippetNo
disable_snippetNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. Added
  4. Removed
  5. Added
  6. Removed
  7. Added
  8. Removed
  9. Added
  10. Removed
  11. Added
  12. Removed
  13. Added
  14. Removed
  15. Added
  16. Removed
  17. Added
  18. Removed
  19. Added
  20. Removed
  21. Added
  22. Removed
  23. Added
  24. Removed
  25. Added
  26. Removed
  27. Added
  28. Removed
  29. Added
  30. Removed
  31. Added
  32. Removed
  33. Added
  34. Removed
  35. Added
  36. Removed
  37. Added
  38. Removed
  39. Added

TDQS

A4.3/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare destructiveHint=true, readOnlyHint=false and openWorldHint=true, and the description adds substantial context beyond them: a WPCode snippet is switched off rather than deleted, a theme-hard-coded id is reported back under skipped with file and line, head_code="" clears emitted code, and confirm=false previews match counts while writing nothing. It also documents the already_applied/skip behavior that makes reruns safe.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The scope statement is front-loaded and each subsequent paragraph addresses a distinct mode (set id, remove id, clear header, surgical replace), so the length is mostly earned. It is dense prose without headers or bullets, which makes the 11-parameter surface harder to scan than it needs to be.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be described, and the description thoroughly covers the destructive paths, verification semantics, and the follow-up removal step. The remaining gap is the unexplained snippet-enable/disable and site-selection parameters, which matter for a tool with 0% schema coverage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% across 11 parameters, so the description carries the full explanatory burden. It covers gtm_id, remove_id, head_code, replace, replace_in and confirm well, but leaves enable_snippet, disable_snippet and site_url entirely unexplained and never names ga4_id explicitly (only 'GA4 measurement id').

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence states a specific verb (set) plus the resource (a WordPress site's GTM or GA4 measurement id, header code, or an old tracking snippet) and enumerates the distinct operating modes. An agent can differentiate it from siblings such as wordpress_tracking or site_tag_gateway without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives strong context for the remove_id path ('This is how you stop a site double-counting after a container change') and routes hard-coded theme copies to wordpress_theme_file(mode="remove_block"). It does not, however, say when to prefer this tool over the read/list counterparts (wordpress_tracking) or over connect_tag_manager/connect_ga4, so a little routing inference is left to the agent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.