Install
openclaw skills install agent-analyticsProduct analytics with your AI agent: set up consent-based tracking, read funnels, paths, retention, experiments, and context, then recommend the smallest growth action using the official Agent Analytics CLI.
openclaw skills install agent-analyticsProduct analytics with your AI agent. Use this skill when a user wants an agent to install Agent Analytics, query product behavior, diagnose activation or retention, inspect paths and funnels, run experiment reads, or decide what growth action to take next.
The CLI is the execution substrate. The scanner is an optional helper for no-code or URL-only audits; when repo code is available, inspect the product code before relying on scanner recommendations. Framework recipes belong in references/growth-recipes.md, not as separate skills.
npx --yes @agent-analytics/cli@0.5.33 <command>.curl, repo-local scripts, MCP tools, or a locally installed binary unless the user explicitly asks.projects, all-sites, create, stats, insights, events, properties, properties-received, breakdown, pages, paths, journey, sessions-dist, retention, funnel, experiments, context, portfolios, feedback, and upgrade-link.report command in CLI 0.5.33. Produce the final report yourself from fixed-command outputs instead of calling report.query only for narrow aggregations the fixed commands cannot answer. Do not start broad growth diagnosis with query; do not build --filter JSON from raw user text.PRO_REQUIRED or a free-tier read cap, explain the blocked answer, run upgrade-link --detached --reason "<why Pro is needed>" --command "<blocked command>", send the dashboard handoff, run whoami after upgrade, then rerun the blocked command. Use upgrade-link --wait only when polling is intentionally desired. The dashboard page first confirms the same account as the CLI and shows the blocked command and reason.create: ^[a-zA-Z0-9._-]{1,64}$.For Claude Code, Codex, Cursor, and local CLI runtimes, start with normal browser approval:
npx --yes @agent-analytics/cli@0.5.33 login
npx --yes @agent-analytics/cli@0.5.33 create my-site --domain https://mysite.com
npx --yes @agent-analytics/cli@0.5.33 events my-site --event <first_useful_event> --days 7 --limit 20
Do not choose detached login just because the work is happening inside an agent. For Paperclip, OpenClaw, and other issue-based runtimes, run login --detached, send the approval URL, wait for the finish code, then complete the printed exchange command.
In OpenClaw and similar managed runtimes, use persistent auth storage and never commit it:
export AGENT_ANALYTICS_CONFIG_DIR="$PWD/.openclaw/agent-analytics"
npx --yes @agent-analytics/cli@0.5.33 login --detached
npx --yes @agent-analytics/cli@0.5.33 auth status
AGENT_ANALYTICS_CONFIG_DIR="$PWD/.openclaw/agent-analytics" npx --yes @agent-analytics/cli@0.5.33 projects
--config-dir "$PWD/.openclaw/agent-analytics" is also valid. Never commit .openclaw/agent-analytics/config.json. See references/setup-auth.md for more setup detail.
Agent Analytics is project-first and portfolio-aware. Before setup, analytics reads, or instrumentation recommendations, classify the target as project-local work, a surface inside a project, or related-project portfolio work.
Decision rules: subdomains are usually surfaces; mobile app is a surface when it shares activation and lifecycle; free tool is a surface when it feeds the same product loop; localhost, staging, local network URLs, and previews are setup or QA surfaces; separate products belong as separate projects under one portfolio. If a URL does not match expectations, do not treat it as immediate failure. Clarify which project and surface it belongs to.
Scope commands: project-local setup or analysis uses project commands; related-project grouping uses portfolios create, portfolios update, and portfolios list; shared goals, roles, and milestones belong in portfolio interpretation only. Canonical docs: https://docs.agentanalytics.sh/guides/projects-surfaces-portfolios/.
For cross-project identity stitching, configure both sides: tracker data-link-domains carries the anonymous _aa value across related domains, but only server-side portfolio scope makes separate projects share identity. Use an identity portfolio with portfolios create, portfolios update, and portfolios list for the membership boundary and privacy-first email lookup scope. data-link-domains alone decorates links but does not make separate projects share identity. Do not claim strict user conversion across projects unless both sides are configured.
When installing tracking or events, use a consent-based, project-owned workflow. Do not guess. Do not overtrack. Do not install generic events that do not map to product goals or a specific workflow in the repo.
Setup order:
create <project> --domain <origin> or projects; --domain is a setup origin, not the project identity.signup_completed, subscription_started, install_completed, project_created, or first_event_received.data-aa-event, data-aa-impression, window.aa.track(...), server-side tracking, aa.identify(...), and aa.set(...). Use scroll depth, form tracking, downloads, vitals/errors/performance, and SPA tracking only when they unlock a concrete growth decision.events <project>, and summarize what the installed events now let the user's agent answer.Copyable setup handoff:
Set up Agent Analytics for this project. If browser approval is needed, open it and wait for me. I will sign in with Google or GitHub and approve it. If the browser callback cannot resume you, ask me for the finish code as a fallback. After that, create or identify the matching Agent Analytics project, install the project-owned tracker, add only meaningful custom events tied to this repo's product workflows, explain what each event enables, and verify the first useful event.
Use context get and context set as compact self-improving memory. At the start of any project-specific analysis, run context get <project> after resolving the project. context set replaces the stored context; always read the existing context first, merge your change, and preserve still-valid goals, activation events, glossary entries, and annotations.
Keep context short. Save durable product truth: goals, activation definitions, event meanings tied to event_name, and date annotations for major product changes: landing page, pricing, onboarding, feature, release, or experiment changes. Before updating glossary entries, inspect current event names with properties <project> or properties-received <project>.
Skip noisy findings: weekly metric values, temporary spikes, pasted reports, raw round notes, long notes, user lists, PII, secrets, git commit logs, and guesses. Do not store git commit logs. Do not invent unsupported fields such as findings, learnings, or open_questions; store only what fits goals, activation_events, event-name glossary, and annotations.
Annotations use occurred_at, title, and optional note. Keep them rare: max 100, JSON body up to 512KB. Analytics responses include annotations only for the requested analytics date range plus one day before and after; context get returns all annotations. For multi-project or multi-domain systems, keep activation and glossary separate unless the human explicitly says they share meaning. Example activations: trial signup plus first item created; teammate invited. This is how the next analysis starts smarter.
Use this closed-loop growth recipe for broad questions like where activation drops, what to fix next, or which experiment to run. It is guidance, not a rigid protocol.
projects.npx --yes @agent-analytics/cli@0.5.33 context get my-site
npx --yes @agent-analytics/cli@0.5.33 funnel my-site --steps-json '[{"event":"page_view"},{"event":"signup_completed"},{"event":"first_value"}]'
context get <project> and treat configured activation events as the activation source of truth. If activation is missing, ask for it or configure it; do not guess silently.properties <project>, properties-received <project>, and recent events <project>.funnel for ordered activation leakage, including population, window, step events, identity basis, strict survivors, largest absolute loss and largest relative loss. Prefer --steps-json when steps or labels need exactness.paths for session-local entry, exit, detour, and drop-off behavior around the activation goal; do not present paths as long-cycle attribution.breakdown around the largest leak by dimensions that exist: path, source, referrer, CTA label, device, browser, country, campaign, plan, surface, or onboarding step.events or journey only for representative inspection or instrumentation sanity.retention for cohorts, not blended active-user claims. Compare cohorts at the same age and note right-censored periods.Funnel analyst behavior: name the population and conversion window, show counts and rates, identify the biggest driver, check segment/surface concentration, and avoid vague tracking advice.
Portfolio surface-role diagnosis: identify each project's role in the growth system, then read project-local metrics against that role. Do not reuse one activation definition across app, docs, directory, landing page, or lead-gen projects unless the user explicitly defines it.
Lead with the decision, then prove it with the metric. For funnels, retention, paths, experiments, attribution, and audits, answer in this shape:
Metric skepticism: Signup is not activation. Prefer retained activated users, revenue, payback, or durable value over signup volume. Funnels diagnose leakage but do not prove why users dropped. Do not call correlation causation without an experiment or causal design. Do not say an experiment won just because conversion moved up. Add the smallest event or property that unlocks the growth question.
Example:
Best bet: fix activation setup friction.
Metric: app onboarding view -> setup copy -> signup -> project_created -> first_event_received within 7d.
Evidence: raw signup/project activity exists, but strict survivors collapse before first_event_received.
Caveat: cross-project identity only counts when portfolio membership and link-domain carrying are configured.
Next: split setup-copy users by selected runtime and first_event_received.
Load references only when they are needed:
references/setup-auth.md: login modes, managed-runtime storage, paid-tier handoff, and safe command examples.references/product-analytics-operating-model.md: projects/surfaces/portfolios, consent-based instrumentation, context upkeep, and verification.references/growth-recipes.md: AARRR, Bullseye, AIDA, STP, JTBD, 4Ps, funnel/retention/experiment recipes, and copyable prompts.Before finishing setup or analysis:
auth status or whoami when relevant.projects or project.events <project> --event <event_name> --days 7 --limit 20.