analytics-and-monitoring

analytics-and-monitoring is a skill for Cursor from kws-projects/react-boilerplate. It costs 0 tokens per session (1,427 once invoked), scanned A, original, MIT.

Project guidance for connecting Google Analytics 4, a website-usage measurement service, and Sentry, an error-monitoring service. It defines shared adapters and typed interfaces so the rest of the application does not call the vendor libraries directly.

In plain words
What is it for?
Use it when adding analytics events, tracking page views, capturing errors, setting user identity, handling consent, or troubleshooting GA4 and Sentry integrations in a React project.
Why use it?
It keeps analytics and error reporting consistent and makes consent, user identity, route tracking, and error context easier to manage. It also provides a defined place to add new tracked events.

Skill for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when adding analytics events, tracking page views, capturing errors, setting user identity, handling consent, or troubleshooting GA4 and Sentry integrations in a React project.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kws-projects/react-boilerplate/analytics-and-monitoring
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add kws-projects/react-boilerplate --skill analytics-and-monitoring
Clone the repo
git clone --depth 1 https://github.com/kws-projects/react-boilerplate

Made for: Cursor.

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 analytics-and-monitoring

README.md
[![agentmods](https://agentmods.dev/badge/skills/kws-projects/react-boilerplate/analytics-and-monitoring/github.svg)](https://agentmods.dev/skills/kws-projects/react-boilerplate/analytics-and-monitoring)
Your own site
<a href="https://agentmods.dev/skills/kws-projects/react-boilerplate/analytics-and-monitoring"><img src="https://agentmods.dev/badge/skills/kws-projects/react-boilerplate/analytics-and-monitoring/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 analytics-and-monitoring

Your own site · 80×15
<a href="https://agentmods.dev/skills/kws-projects/react-boilerplate/analytics-and-monitoring"><img src="https://agentmods.dev/badge/skills/kws-projects/react-boilerplate/analytics-and-monitoring.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,427 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.
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.00000 $0.01427
Opus 5 $0.00000 $0.00714
Sonnet 5 $0.00000 $0.00285
Haiku 4.5 $0.00000 $0.00143

Measured 11d ago against content hash 487fba417cd1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

analytics-and-monitoring 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 11d 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.

.cursor/skills/analytics-and-monitoring/SKILL.md · 181 lines

How it starts

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

Analytics & Monitoring

Work with the GA4 analytics and Sentry error-monitoring integrations in this project. Use when adding events, capturing errors, configuring user identity, managing consent, or troubleshooting the integration.

Architecture overview

Both integrations follow the adapter pattern: a thin typed wrapper in src/lib/ owns the SDK, and all other code uses the adapter (or the React hooks) — never the raw SDK.

src/lib/analytics.ts    → GA4 gtag.js adapter
src/lib/monitoring.ts   → Sentry adapter (also re-exports ErrorBoundary)
src/types/analytics.ts  → Typed event definitions
src/types/monitoring.ts → Error context / user / breadcrumb types
src/hooks/useAnalytics.ts     → React hook (route-aware)
src/hooks/useMonitoring.ts    → React hook
src/hooks/usePageTracking.ts  → Auto page-view on route change
src/components/ErrorFallback.tsx → Fallback UI for SentryErrorBoundary

GA4 — Adding a new tracked event

  1. Define the event shape in src/types/analytics.ts:

    export type FeatureUsedEvent = {
      name: 'feature_used'
      params: { feature: string; duration_ms?: number }
    }
    
  2. Add it to the AnalyticsEvent union in the same file.

  3. Track it from feature code:

    import { analytics } from '@/lib/analytics'
    analytics.track({ name: 'feature_used', params: { feature: 'export' } })
    

    Or via the hook:

    const { track } = useAnalytics()
    track({ name: 'feature_used', params: { feature: 'export' } })
    

Event naming rules (GA4)

  • Use snake_case, max 40 characters.
  • Avoid GA4 reserved names: click, error, first_visit, page_view, scroll, session_start, user_engagement.
  • Prefer recommended events (login, sign_up, search, share, select_content, exception) when they fit — GA4 provides enhanced reporting for these.

User identification (GA4)

analytics.setUserId(user.id)                    // after login — internal ID only, no PII
analytics.setUserProperties({ plan: 'pro' })    // user-scoped custom dimensions
analytics.clearUserId()                          // on logout

Read the full file on GitHub · 181 lines

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. 11d ago First seen · 181 lines · 0 tokens per session scan A 487fba417cd1

Subscribe to this mod's changes

analytics-and-monitoring is a skill published in the GitHub repository kws-projects/react-boilerplate (3 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,427 tokens. 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-31.

Related

Other skills, from other repositories

i18n-date-patterns

Implements internationalization (i18n) in React applications. Covers user-facing strings, date/time handling, locale-aware formatting, ICU MessageFormat, and RTL support. Use when building multilingual UIs or formatting dates/currency.

yonatangross/orchestkit · 53 tokens

traffic-diagnosis

Systematically diagnose why traffic changed — spike, drop, or shift in mix. Follow these steps in order. Each step narrows the hypothesis.

surendranb/google-analytics-mcp · 34 tokens

ultracite

Ultracite is a zero-config linting and formatting preset for JavaScript/TypeScript projects. Use when: (1) Setting up or initializing Ultracite in a project (ultracite init), (2) Running linting or formatting commands (check, fix, doctor), (3) Writing or reviewing JS/TS code in a project that uses Ultracite — to…

agustinusnathaniel/nextarter-tailwind · 142 tokens

rtl-bug-repro

Reproduce an RTL bug with a minimal TB and isolate root cause via waveform diff — 'reproduce this bug', 'minimal repro TB', regression failure isolation.

babyworm/rtl-agent-team · 38 tokens

integration-rule-engine

A declarative routing engine that turns ticket / error attributes (reporter, label, project, area path, error class, environment) into a tag + AI agent + priority assignment, so cross-source workflows ("security tickets always go to the OWASP reviewer") stay out of code and in user-editable rules.

aozyildirim/Agena · 67 tokens

bug-screenshot-annotation

Turns a raw bug screenshot into a QA-style annotated evidence image — circles/ovals around the broken region, arrows, callout text boxes, a 'BUG — ' corner badge, and axis tick-marks for date/offset bugs. Use whenever a bug is visual or positional (overlapping elements, misalignment, wrong date/offset on a chart axis…

upex-galaxy/agentic-qa-boilerplate · 287 tokens