stacksjs/bench-review/stacks-analytics

Claude Code and agent skill by stacksjs/bench-review

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when adding analytics to a Stacks application — configuring Fathom or self-hosted analytics, generating tracking scripts, privacy-friendly analytics setup, or the analytics configuration. Covers @stacksjs/analytics and config/analytics.ts.

Install

npx vskill@latest install stacksjs/bench-review/stacks-analytics

SKILL.md

The same SKILL.md was published earlier as stacksjs/bench-review/stacks-analytics.

Stacks Analytics

Privacy-friendly analytics with Fathom and self-hosted driver support.

Key Paths

  • Core package: storage/framework/core/analytics/src/
  • Configuration: config/analytics.ts

Drivers

Fathom Analytics

Privacy-focused, GDPR-compliant analytics. Requires a Fathom account.

Self-Hosted Analytics

Generate tracking scripts for self-hosted analytics:

typescript
import { generateSelfHostedScript, getSelfHostedAnalyticsHead, generateInlineScript } from '@stacksjs/analytics'
// Generate tracking script tag
const script = generateSelfHostedScript({
siteId: 'ABCDEF',
apiEndpoint: 'https://analytics.myapp.com/api/event',
honorDnt: true, // respect Do Not Track
trackHashChanges: false, // track hash URL changes
trackOutboundLinks: true // track external link clicks
})
// Generate head configuration for STX
const headConfig = getSelfHostedAnalyticsHead({
siteId: 'ABCDEF',
apiEndpoint: 'https://analytics.myapp.com/api/event'
})
// Generate inline script (no external JS file)
const inline = generateInlineScript(config)

SelfHostedConfig Interface

typescript
interface SelfHostedConfig {
siteId: string // unique site identifier
apiEndpoint: string // analytics API URL
honorDnt?: boolean // respect Do Not Track header
trackHashChanges?: boolean // track SPA hash navigation
trackOutboundLinks?: boolean // track clicks to external sites
}

config/analytics.ts

typescript
{
driver: 'fathom', // 'fathom' | 'google-analytics'
drivers: {
googleAnalytics: {
trackingId: '' // GA tracking ID
},
fathom: {
siteId: '' // Fathom site ID
}
}
}

Dashboard Integration

Analytics dashboard at /dashboard/analytics displays:

  • Page views and visitor counts
  • Traffic sources
  • Popular pages
  • Engagement metrics

Gotchas

  • Default driver is fathom — privacy-focused by default
  • Self-hosted analytics require your own analytics endpoint
  • honorDnt: true respects browser Do Not Track settings
  • escapeAttr() is used internally to prevent XSS in generated scripts
  • Google Analytics tracking ID goes in config, not env (unless you override)
  • Analytics scripts are generated server-side and injected into page head
  • Fathom is a paid service — self-hosted is free but requires infrastructure
  • trackOutboundLinks adds click handlers to external <a> tags

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
3
7-day trend score
12

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/stacksjs/bench-review/stacks-analytics/badge)](https://verified-skill.com/skills/stacksjs/bench-review/stacks-analytics)

Something wrong with this skill or its page? Tell us.