add-analytics

add-analytics is a skill for Claude Code from LeoYeAI/openclaw-master-skills. It costs 32 tokens per session (4,710 once invoked), scanned A, original, MIT.

A setup helper for Google Analytics 4, Google's service for measuring activity on a website or app. It detects the project's technology and adds tracking code, events, and privacy-related settings when requested.

In plain words
What is it for?
Adding a Google Analytics measurement ID, configuring custom events, enabling development debugging, and connecting tracking to cookie-consent controls.
Why use it?
It removes the manual work of fitting analytics into different web frameworks. It also checks for existing tracking and helps avoid adding a second or conflicting setup.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import Analytics from '../components/Analytics.astro'.

Good fit Adding a Google Analytics measurement ID, configuring custom events, enabling development debugging, and connecting tracking to cookie-consent controls.

Compare 6 skills from other repositories ↓
About the project

OpenClaw Master Skills is a curated, regularly updated collection of skills that extends an AI personal assistant platform with capabilities such as research, browser automation, presentation creation, and prompt work. It is intended for people using OpenClaw or MyClaw.ai to give their agents additional tasks and workflows. The catalogue contains many skills and agents from this collection.

LeoYeAI/openclaw-master-skills · 2,168 stars · on GitHub · myclaw.ai

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills
agentmods
npx agentmods add skills/leoyeai/openclaw-master-skills/add-analytics

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for add-analytics

README.md
[![agentmods](https://agentmods.dev/badge/skills/leoyeai/openclaw-master-skills/add-analytics/github.svg)](https://agentmods.dev/skills/leoyeai/openclaw-master-skills/add-analytics)
Your own site
<a href="https://agentmods.dev/skills/leoyeai/openclaw-master-skills/add-analytics"><img src="https://agentmods.dev/badge/skills/leoyeai/openclaw-master-skills/add-analytics/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for add-analytics

Your own site · 80×15
<a href="https://agentmods.dev/skills/leoyeai/openclaw-master-skills/add-analytics"><img src="https://agentmods.dev/badge/skills/leoyeai/openclaw-master-skills/add-analytics.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,710 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Prompt Injection · line 17
    This pattern attempts to override system instructions or ignore safety constraints. Without LLM analysis, manual review is recommended.
    Fix: Remove or rewrite any text that instructs the agent to ignore prompts, override safety rules, or trust unverified content. Ensure skill content cannot be injected to alter agent behavior.
  • high Prompt Injection · line 670
    This pattern attempts to override system instructions or ignore safety constraints. Without LLM analysis, manual review is recommended.
    Fix: Remove or rewrite any text that instructs the agent to ignore prompts, override safety rules, or trust unverified content. Ensure skill content cannot be injected to alter agent behavior.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00032 $0.04710
Opus 5.5 $0.00013 $0.01884
Sonnet 5.5 $0.00006 $0.00942
Haiku 4.5 $0.00003 $0.00471

Measured 2mo ago against content hash 9c2201c5e5c1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

add-analytics scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/add-analytics/SKILL.md · 772 lines

How it starts

The opening of the file, as written. The whole thing — 772 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Google Analytics 4 Setup Skill

You are setting up Google Analytics 4 (GA4) for a project. Follow this comprehensive guide to add analytics properly.

Arguments

Parse the following from $ARGUMENTS:

  • Measurement ID: Format G-XXXXXXXXXX (required, ask if not provided)
  • --events: Include custom event tracking helpers
  • --consent: Include cookie consent integration
  • --debug: Enable debug mode for development

Step 1: Detect Project Type

Scan the project to determine the framework/setup:

Priority detection order:
1. next.config.js/ts → Next.js
2. nuxt.config.js/ts → Nuxt.js
3. astro.config.mjs → Astro
4. svelte.config.js → SvelteKit
5. remix.config.js → Remix
6. gatsby-config.js → Gatsby
7. vite.config.js + src/App.vue → Vue + Vite
8. vite.config.js + src/App.tsx → React + Vite
9. angular.json → Angular
10. package.json with "react-scripts" → Create React App
11. index.html only → Plain HTML
12. _app.tsx/jsx → Next.js (App Router check: app/ directory)

Also check for:

  • TypeScript usage (tsconfig.json)
  • Existing analytics (search for gtag, GA, analytics)
  • Package manager (pnpm-lock.yaml, yarn.lock, package-lock.json)

Step 2: Validate Measurement ID

The Measurement ID must:

  • Start with G- (GA4 format)
  • Be followed by exactly 10 alphanumeric characters
  • Example: G-ABC1234567

If the user provides a UA- ID, inform them:

"You provided a Universal Analytics ID (UA-). GA4 uses Measurement IDs starting with 'G-'. Universal Analytics was sunset in July 2024. You'll need to create a GA4 property at analytics.google.com"

Step 3: Implementation by Framework

Next.js (App Router - app/ directory)

Create app/layout.tsx modification or create components/GoogleAnalytics.tsx:

// components/GoogleAnalytics.tsx
'use client'

import Script from 'next/script'

interface GoogleAnalyticsProps {
  measurementId: string
}

export function GoogleAnalytics({ measurementId }: GoogleAnalyticsProps) {
  return (
    <>
      <Script
        src={`https://www.googletagmanager.com/gtag/js?id=${measurementId}`}
        strategy="afterInteractive"
      />
      <Script id="google-analytics" strategy="afterInteractive">
        {`
          window.dataLayer = window.dataLayer || [];
          function gtag(){dataLayer.push(arguments);}
          gtag('js', new Date());
          gtag('config', '${measurementId}');
        `}
      </Script>
    </>
  )
}

Read the full file on GitHub · 772 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 772 lines · 32 tokens per session scan A 9c2201c5e5c1

Subscribe to this mod's changes

add-analytics is a skill published in the GitHub repository LeoYeAI/openclaw-master-skills (2,168 stars, last pushed 6d ago), licensed MIT. It adds 32 tokens to every session and 4,710 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

add-analytics compared with skills from other repositories

add-analytics next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
add-analyticsLeoYeAI/openclaw-master-skillsSkill2.2k6d agoMITA32Claude Code
pentest-api-deepjd-opensource/JoySafeterSkill31518d agoApache-2.0A43Claude Code, Codex
agent-forgeAlekseiUL/agentforge-openclawSkill449d agoMITA111Claude Code, Codex
investlongsizhuo/openInvestSkill139todayMITB280Claude Code
aeonagent-skills-hub/agent-skills-hubSkill1281mo agoMITA74Claude Code, Codex
halo-cli-shophalo-dev/cliSkill304d agoMITA78Claude Code, Codex
halo-cli-moderation-notificationshalo-dev/cliSkill304d agoMITA57Claude Code, Codex