Skip to main content
Glama
kLOsk

Google Ads - AdLoop

by kLOsk

generate_tracking_code

Read-only

Generate GA4 event tracking JavaScript code with gtag snippets. Includes recommended parameters and supports triggers like form submit or button click. Optionally verifies if the event already exists.

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
event_nameYes
event_paramsNo
triggerNo
property_idNo
check_existingNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

Annotations indicate readOnlyHint=true and destructiveHint=false, so the tool is read-only. The description adds that it generates code and optionally checks GA4, which aligns with annotations. No contradictions, and it provides behavioral context beyond 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 four sentences, front-loaded with a clear summary, then details on trigger and optional check. Every sentence adds value with no unnecessary words.

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?

Given 5 parameters and an output schema, the description covers core purpose, trigger options, and optional check. Missing details on property_id and event_params format, but output schema handles return documentation. Fairly complete for a code-generation tool.

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%, so the description must explain parameters. It explains trigger with specific options, mentions event_name implicitly, and refers to recommended parameters for event_params. However, property_id and event_params format are not clarified, leaving some gaps.

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 generates a GA4 event tracking JavaScript snippet, which is a specific verb+resource. Among siblings focused on ads and campaigns, this is the only tracking code generation tool, so it distinguishes well.

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 explains when to use: to produce ready-to-paste gtag code for specified events, and optionally checks if the event already fires. However, it does not explicitly state when not to use or provide alternatives, leaving usage context implied rather than explicit.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kLOsk/adloop'

If you have feedback or need assistance with the MCP directory API, please join our Discord server