Trakiie for coding agents
This page is written for coding agents. When a person says Set up https://trakiie.tamilini92.workers.dev in this project, follow these steps in their repository. The same steps are at /skill.md as a skill file.
1. Read the app first
- The person said "Set up https://trakiie.tamilini92.workers.dev in this project". https://trakiie.tamilini92.workers.dev is this analytics service, not the app to track.
- Find the framework, package manager, shared layout or page head, hosting (Cloudflare Workers, Vercel or Next.js, or other), existing analytics, and the checkout or payment code.
- Find the app's own domain from its canonical URL, deploy config or package homepage. If it's missing or unclear, ask. Never invent one.
2. Sign in and create the site
- From the repository root run
npx trakiie@latest start <app-domain>(Node 18 or newer). - It prints a code and a link. Ask the person to open the link and approve, and keep the command running until it finishes.
- If it says the account has no plan, give the person the billing link it printed and wait for them. Never pick or buy a plan yourself.
- It writes
.trakiie.json(the site id, safe to commit), addsTRAKIIE_CRAWL_KEYto.env, makes sure.envis git-ignored, and installs this file as.claude/skills/trakiie-setup/SKILL.md. If you are reading it there, carry on: you are the agent it's meant for.
3. Add the tracking script
- Add it once, in the shared layout or page head:
<script defer src="https://trakiie.tamilini92.workers.dev/t.js" data-site="SITE_ID"></script>, with SITE_ID from.trakiie.json. - Keep existing analytics. Don't add the script twice, and don't load it inside iframes.
4. Track a few real goals
- Pick 2 to 4 outcomes that exist in the code, like a signup, a trial start or a key action. Explain the choice in one line each.
- After the action succeeds, call
window.trakiie?.("signup"), or adddata-goal="signup"to the button. Extra fields go asdata-goal-plan="pro"or a second argument. - No emails, names or other personal data in goal fields.
5. Log AI readers on the server
- Cloudflare Workers: run
npx trakiie@latest snippet cloudflareand add it to the fetch handler after the response is ready. Next.js: runnpx trakiie@latest snippet nextand merge it intomiddleware.js(keep any existing middleware logic). - Read the key from the environment (
env.TRAKIIE_CRAWL_KEYorprocess.env.TRAKIIE_CRAWL_KEY) instead of pasting it into code. The person sets it on their host; tell them the exact command, likenpx wrangler secret put TRAKIIE_CRAWL_KEY. - The snippet only reports AI bots in the background. Never block or slow a bot. Other hosting: skip this step and say so in the handoff.
6. Connect payments
- Supported: Stripe, Dodo Payments, Lemon Squeezy, Polar and Paddle. Find which one the checkout code uses.
- Where the checkout is created, pass the browser's
trakiie.visitor()value through to the server and attach it astrakiie_visitor_id: inmetadatafor Stripe, Dodo and Polar (for Stripe subscriptions also insubscription_data.metadata), incheckout_data.customfor Lemon Squeezy, and incustomDatafor Paddle. Adatafast_visitor_idthat's already there works too. - The person then adds a webhook in their provider pointing at that provider's URL from
npx trakiie@latest status, ticks the events listed on the site's setup page, and pastes its signing secret there. You can't do this part; give them both links. - Any other payment provider isn't supported yet. Say so instead of building a workaround.
7. Check that data arrives
- The tracker ignores localhost on purpose, so local runs won't show up. Run the type check and build, and test checkout only in test mode.
- After the person deploys, run
npx trakiie@latest check. It shows events, AI reads and payments from the last 24 hours. Don't say tracking works until it shows events. - Don't deploy unless the person asked you to.
8. Hand off
- Summarize: the site and dashboard link, the goals you added, the files you changed, and what is still pending (deploy, the crawler key on the host, the payment webhook).
- Never print or commit the crawler key or the CLI token.
After setup
- Once the plan starts, the person can connect you to their numbers over MCP from the Connect your agent page in the app.