Skip to main content
Glama
kLOsk

Google Ads - AdLoop

by kLOsk

Generate tracking code

generate_tracking_code
Read-only

Generate a GA4 event tracking JavaScript snippet with gtag code, including recommended parameters and optional duplicate-event check. Wrap the call in a form, button, or page-load listener.

Instructions

Generate a GA4 event tracking JavaScript snippet.

Produces ready-to-paste gtag code for the specified event. Includes recommended parameters for well-known GA4 events (sign_up, purchase, etc.). Optionally checks GA4 to warn if the event already fires.

trigger: "form_submit", "button_click", or "page_load" — wraps the gtag call in an appropriate event listener. Empty = bare gtag call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
triggerNo
event_nameYes
property_idNo
event_paramsNo
check_existingNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.13.2
  2. Removedv0.13.0
  3. First observedv0.9.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, and the description aligns by describing generation of code and an optional read-only check against GA4. It adds context about the 'ready-to-paste' output and the check, but no side effects are mentioned, which is consistent with the annotations.

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

Conciseness5/5

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

The description is concise, consisting of two sentences that front-load the main action and then elaborate on the output and optional check. No redundant information or unnecessary detail is present.

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

Completeness3/5

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

The description covers the core purpose and mentions the optional check, but it lacks details about the output format (e.g., the structure of the gtag code), the exact behavior when 'check_existing' is false, or how 'event_params' is used. Given the tool's complexity (5 parameters, nested object in schema), the description is not fully complete.

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

Parameters2/5

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

The description explicitly explains the 'trigger' parameter and implicitly references 'event_name' and 'check_existing', but it does not clarify the purpose of 'property_id' or 'event_params'. Given the schema has 5 parameters, this leaves a significant gap in understanding the full input requirements.

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 description clearly states the tool's function: generating a GA4 event tracking JavaScript snippet. The verb 'generate' is specific, and the resource (GA4 event tracking code) distinguishes it from sibling tools like 'get_tracking_events' or 'validate_tracking'.

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

Usage Guidelines3/5

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

The description implies when to use the tool (e.g., to produce tracking code, with optional checks for existing events) but does not explicitly contrast it with alternatives. Siblings like 'validate_tracking' exist, but no clear 'use this instead of X' guidance is provided.

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

Deploy Server

Other Tools