GA4
AnalyticsPurchase events. Sends trusted GA4 purchase events with stable order, product, and revenue details.
Server events. Turns trusted payment and app events into GA4 records without duplicate counts.
Refund events. Sends server-side refund events that reverse the matching recorded revenue.
Track the path from first click to paid customer.
Mined from production apps and scanned for secrets on every release. Typed end to end.
GA4 starter code pack
A production-mined GA4 structure for client tags, attribution, consent, funnel checkpoints, server-side purchases, refunds, and event verification.
After you buy, one prompt pulls it in
Click, then paste into your AI chat. Your agent installs Boost OS and wires in the GA4 starter code pack.
Then just tell your agent what you want
Your AI coding agent · with Boost OS
Track purchases from my server so refunds and retries don't inflate revenue.
Building from the GA4 pack:
Server purchase events from src/purchases, refund events from src/refunds, and attribution from src/attribution.
Everything stays wired through src/lib/app-adapter.ts, with stable event IDs so retries never count twice.
- Cursor
- Claude Code
- Codex
- GitHub Copilot
- Windsurf
What you get
- Install the client tag without duplicate page views
- Carry campaign details from click to sale
- Respect consent before tracking visitors
- Record each funnel checkpoint consistently
- Send purchases and refunds from your server
- Verify events before trusting reports
The move list
14 modules across three jobs. Open any module to see every file inside it.
Get paid
Take the money: one-time, recurring, metered, or agent-initiated.
After the sale
Deliver access, send the emails, and handle refunds without drama.
The safety rails
The plumbing that keeps every event verified and every grant counted once.
- Server eventsTurns trusted payment and app events into GA4 records without duplicate counts.2 files
- Event verificationChecks event names, required values, consent, and delivery before reports are trusted.1 file
- Analytics libraryCentralizes event names, safe properties, attribution values, and server delivery helpers.5 files
- Client tag and consentMaps the GA4 tag, consent choices, environment values, and Next.js page tracking.15 files
Provenance
Extracted from production GA4 revenue tracking serving real customers
Frequently asked questions
Is this a GA4 Next.js starter?
Yes. The pack is built for Next.js apps that need client tags, consent-aware tracking, campaign attribution, funnel events, server-side revenue events, and verification.
Does it include GA4 purchase and refund events?
Yes. It sends trusted purchase and refund events from your server with stable order details so retries do not inflate revenue.
Is the GA4 code pack available now?
Yes. Every active Boost OS license includes it with no separate purchase; onboard it from the pill on this page: click, paste the prompt into your AI chat, and your agent does the rest.
Can I convert this pack to Python or another language?
The GA4 pack ships in TypeScript. Every module is adapter-based and written with plain comments, so you can ask your AI agent in chat to convert any module to your language and keep the logic intact. The TypeScript version stays the source of truth for updates.
Add the GA4 card to your collection
One $199 license includes every current and future production code pack.
Get Boost OS