Real example projects that show how to integrate Agent Analytics into websites, storefronts, tools, and other product surfaces.
Path: examples/astro-velvet-paw
A fictional ecommerce / affiliate storefront for premium cat sneakers. It demonstrates a focused Agent Analytics integration for a static storefront:
- tracker snippet installation
- automatic page/session/referrer/UTM/device context
- declarative CTA clicks with
data-aa-event - section impressions with
data-aa-impression - runtime events with
window.aa.track(...) - outbound merchant-click conversion tracking
- an experiment seam with
window.aa.experiment(...) - opt-in performance, Core Web Vitals, scroll depth, and time-on-page signals
Primary KPI: outbound_merchant_click.
The example intentionally avoids fake cart, checkout, purchase, login, and order lifecycle events. Checkout happens on the merchant site, so the honest conversion is the shopper's merchant handoff.
cd examples/astro-velvet-paw
npm install
npm run dev
npm test
npm run check
npm run buildexamples/
astro-velvet-paw/
src/
tests/
public/
Each example ships with placeholder project credentials. Create an Agent Analytics project, then replace the placeholder values in the example's tracker snippet before deploying.
<script defer src="https://api.agentanalytics.sh/tracker.js"
data-project="your-project"
data-token="aat_your_token"></script>For live verification, use the Agent Analytics CLI:
npx --yes @agent-analytics/cli@0.5.21 events your-project --days 7 --limit 20Examples should be product-first. They should look and read like the surface they represent, while the analytics integration stays visible in code and documentation. Avoid adding fake lifecycle events just to show more tracking surface.