skills/google-analytics/SKILL.md
Sets up, configures, and optimizes Google Analytics 4 (GA4) properties. Evaluates websites for proper GA4 implementation, tracking codes, and configuration improvements. Uses the Google Analytics Admin API for programmatic setup or provides manual integration paths via gtag.js or Next.js Third Parties.
npx skillsauth add baphomet480/claude-skills google-analyticsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill provides a standardized approach to setting up, verifying, and optimizing Google Analytics 4 properties. It covers programmatic setup via the Google Analytics Admin API, manual code integration, and optimization audits.
G-XXXXXXXXXX IDs in the source code.ga_admin.py script to create properties and data streams programmatically.@next/third-parties/google for Next.js, or raw gtag.js for plain HTML).If the user needs a new property, you have two choices:
analytics.google.com to create a property and retrieve the G-XXXXXX Measurement ID.analytics.manage scopes, you can use the Analytics Admin API to provision properties and web streams on behalf of the user.Implement the tracking code using the most appropriate method for the user's stack.
Next.js (App Router)
Use the official @next/third-parties/google library.
import { GoogleAnalytics } from '@next/third-parties/google'
export default function RootLayout({ children }) {
return (
<html lang="en">
<body>{children}</body>
<GoogleAnalytics gaId="G-XYZ" />
</html>
)
}
Standard HTML/Vanilla JS
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XYZ"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XYZ');
</script>
Standard page views are tracked automatically in GA4. However, you should evaluate the project for valuable custom events.
add_to_cart, begin_checkout, and purchase.Sending Custom Events (Next.js Example)
import { sendGAEvent } from '@next/third-parties/google'
export function EventButton() {
return (
<button
onClick={() => sendGAEvent('event', 'buttonClicked', { value: 'xyz' })}
>
Send Event
</button>
)
}
scripts/ga_admin.py: A python script that interacts with the Google Analytics Admin API to list accounts, properties, and create web data streams. Requires google-analytics-admin package and GCP credentials.NEXT_PUBLIC_GA_ID).G-XXXXX).gtag.js script tags. Only one core tag is needed per page.development
Open-source intelligence on people, companies, domains, and B2B accounts. Use when the user wants to investigate, vet, research, or build a dossier on a target — phrases like "OSINT", "due diligence", "background check", "research this person", "look into [company/domain]", "vet this prospect/vendor", "what does X do", "is this account worth pursuing", "find me a contact at", "who's the buyer for", or any open-source investigation task. Disambiguates identities before reporting and grades every claim by independent source count.
development
Generate, edit, describe, restyle, restore, thumbnail, and batch-process images using xAI (Grok) or OpenAI image APIs and GPT-4o vision. Default provider is xAI ($0.02/image flat rate). Use this skill whenever the user asks to generate, create, make, draw, or design an image or picture using AI, or wants to edit, modify, transform, restyle, composite, or inpaint an existing image. Also handles image description and alt-text generation, background removal, style transfer, photo restoration, thumbnail creation, and batch generation from JSON manifests. Trigger when the user mentions DALL-E, gpt-image, Grok image, xAI image, OpenAI image generation, or wants AI-generated visuals for any purpose (logos, mockups, illustrations, thumbnails, icons, concept art, memes). Also trigger for batch image generation, generating a set or series of images, processing multiple images from a manifest, or creating consistent image collections. If the user says "make me an image of...", "generate a picture", "edit this photo to...", "describe this image", "remove the background", "make this look like watercolor", "restore this old photo", "create a thumbnail", "generate a batch of images", or "process this image manifest", this is the skill to use.
testing
Agentic OS Orchestrator. Process and execute tasks from the shared .agent/state/tasks.json queue. Use when the user asks to 'check the queue', 'process tasks', or run the heartbeat.
tools
Delegate a sub-task to Claude Code via the Agent Client Protocol (ACP). Use this skill whenever you want to hand off work to Claude — complex agentic coding with MCP tool access, detailed multi-file refactors, tasks requiring Claude's reasoning style, or anything where Claude's strengths give an advantage. Also invoke when the user asks you to "ask Claude", "use Claude for this", or "run this through Claude". The script handles subprocess lifecycle and ACP session setup; you just provide the prompt and read stdout.