Skip to content

Analytics and UTM attribution for launch day

Know which launch site, post and AI assistant sent each signup, not just how many visitors came.

  • Free, no sign-up
  • 45 to 90 minutes with an agent
  • By Devvrat Hans
  • Version 1.0, updated Oct 26, 2026

1Your site and stack

Optional. The prompt adapts as you type; leave a field blank and the agent works it out.

2Copy it into your agent

launch-analytics-attribution.md69 lines, about 1,134 tokens

Paste into any coding agent: Claude Code, Cursor, Codex, Copilot, Windsurf or Cline.

# Analytics and UTM attribution for launch day

When the production site launches I will post on several launch sites and social networks on the same day. I need to know which of them sent the people who signed up, not only how many visitors arrived. Set up analytics with the analytics tool this project already uses (or tell me the options if there is none), capture UTM parameters and referrers, and store the first touch with each new account.

Site: not given. Find the production URL in the project config, or ask me.

## Ground rules

1. Read before you write. Explore the parts of the codebase this job touches and tell me what is already in place.
2. Plan, then stop. Give me a numbered plan: what you will change, in which files, and why. Wait for my approval before editing anything.
3. Fix things at their source (the shared layout, the config, the generator), not with one-off patches page by page.
4. Keep the project's conventions: its framework APIs, file layout, naming and code style. Add no new dependency without asking.
5. Where something is already done well, say so and leave it alone.

## You will not

- Edit `.env` files, secrets or API keys, or print their values.
- Deploy, push, merge or publish anything.
- Delete data, or run migrations or scripts against a production database.
- Add tracking, third-party scripts or links to any site I did not ask for.
- Change copy, design or behaviour that this job does not need.
- Add a second analytics tool when one already exists, unless I agree.
- Send personal data (emails, names) to the analytics tool.

## Your stack

- Framework: Work out the framework, router and build output from the project files (package.json, lockfiles, framework config) before planning, and say which you found.
- Host: Work out where the site is hosted from the config files (vercel.json, netlify.toml, wrangler config, Dockerfile, fly.toml) and say which you found.

## Steps

### 1. Check what is there

Find any existing analytics script, event calls, cookie or consent banner, and where sign-up completes on the server. Tell me what is tracked today and what is missing.

### 2. Pageviews and the events that matter

Make sure pageviews are recorded on every page, including client-side route changes. Add events for the steps of the launch funnel: sign-up started, sign-up completed, and the first meaningful action in the product (name it with me). Use the tool's documented API, and keep event names short and consistent (`signup_completed`, not `User Signed Up!`).

### 3. Capture where each visitor came from

- On the first page view of a visit, read `utm_source`, `utm_medium`, `utm_campaign`, `utm_content` and `utm_term`, plus `document.referrer`, and keep them (a first-party cookie or `localStorage`, 30 days) until sign-up.
- When an account is created, save that first touch on the user record (new nullable columns or a small table), so I can count signups by source in the database even if an ad blocker hid the analytics event.
- Treat referrers from AI assistants as their own source: chatgpt.com, chat.openai.com, perplexity.ai, claude.ai, gemini.google.com, copilot.microsoft.com. Store them as, for example, `ai:perplexity`.

### 4. Respect consent and privacy

If the site shows a consent banner, analytics that set cookies must wait for consent; the first-touch capture should only store the UTM and referrer values, never personal data. Update the privacy policy's list of tools if a new one is added, and show me the wording.

### 5. Give me launch links

Write a short table of UTM links I can use on launch day, one per channel (each launch site, X, LinkedIn, Reddit, Hacker News, my newsletter), with `utm_source` set to the channel and `utm_campaign=launch`. Explain how to see signups by source in the analytics tool this project already uses (or tell me the options if there is none) and with one database query.

## Done means

- [ ] Pageviews are recorded on every page, including client-side navigation.
- [ ] Sign-up started and completed events fire once each, with consistent names.
- [ ] The first UTM source and referrer are saved on every new account.
- [ ] AI assistant referrers are recorded as their own sources.
- [ ] I have a table of launch-day UTM links and a query that counts signups by source.

## Report back

When you finish, give me:

- what you changed, file by file;
- anything you skipped, and why;
- anything I must do by hand (DNS records, dashboards, accounts, deploys);
- how to check each change on the live site.

One-line version

For agents that can read a URL. It fetches this prompt with your settings applied.

Read https://abacklaunch.com/prompts/launch-analytics-attribution.md and follow it for this project.

3Check the result

When the changes are live, run these free checks. Add your site URL above and each one opens already running on it.

This prompt will not

  • Edit .env files, secrets or API keys, or print their values.
  • Deploy, push, merge or publish anything.
  • Delete data, or run migrations or scripts against a production database.
  • Add tracking, third-party scripts or links to any site I did not ask for.
  • Change copy, design or behaviour that this job does not need.
  • Add a second analytics tool when one already exists, unless I agree.
  • Send personal data (emails, names) to the analytics tool.

It reads your code first, shows you a plan, and waits for your approval before it changes anything.

What you get

  • Analytics events for each step of your launch funnel
  • The first UTM source and referrer saved with every new account
  • AI assistant referrals counted as their own sources
  • A ready table of UTM links for launch day

How to use this prompt

  1. 1

    Describe your stack

    Add your site, framework and host. The prompt adapts; blank fields are left for the agent to work out.

  2. 2

    Paste it into your agent

    Open your project in Claude Code, Cursor, Codex, Copilot, Windsurf or Cline, and paste the prompt or the one-line version.

  3. 3

    Approve the plan

    The agent reads your code, shows you a plan with the files it will touch, and waits. Change anything you disagree with.

  4. 4

    Check the result

    When the changes are live, run the free checks below on your site to confirm each fix.

What the agent does

When the production site launches I will post on several launch sites and social networks on the same day. I need to know which of them sent the people who signed up, not only how many visitors arrived. Set up analytics with the analytics tool this project already uses (or tell me the options if there is none), capture UTM parameters and referrers, and store the first touch with each new account.

  1. 1. Check what is there

    Find any existing analytics script, event calls, cookie or consent banner, and where sign-up completes on the server. Tell me what is tracked today and what is missing.

  2. 2. Pageviews and the events that matter

    Make sure pageviews are recorded on every page, including client-side route changes. Add events for the steps of the launch funnel: sign-up started, sign-up completed, and the first meaningful action in the product (name it with me). Use the tool's documented API, and keep event names short and consistent (signup_completed, not User Signed Up!).

  3. 3. Capture where each visitor came from

    • On the first page view of a visit, read utm_source, utm_medium, utm_campaign, utm_content and utm_term, plus document.referrer, and keep them (a first-party cookie or localStorage, 30 days) until sign-up.
    • When an account is created, save that first touch on the user record (new nullable columns or a small table), so I can count signups by source in the database even if an ad blocker hid the analytics event.
    • Treat referrers from AI assistants as their own source: chatgpt.com, chat.openai.com, perplexity.ai, claude.ai, gemini.google.com, copilot.microsoft.com. Store them as, for example, ai:perplexity.
  4. 4. Respect consent and privacy

    If the site shows a consent banner, analytics that set cookies must wait for consent; the first-touch capture should only store the UTM and referrer values, never personal data. Update the privacy policy's list of tools if a new one is added, and show me the wording.

  5. 5. Give me launch links

    Write a short table of UTM links I can use on launch day, one per channel (each launch site, X, LinkedIn, Reddit, Hacker News, my newsletter), with utm_source set to the channel and utm_campaign=launch. Explain how to see signups by source in the analytics tool this project already uses (or tell me the options if there is none) and with one database query.

Done means

  • Pageviews are recorded on every page, including client-side navigation.
  • Sign-up started and completed events fire once each, with consistent names.
  • The first UTM source and referrer are saved on every new account.
  • AI assistant referrers are recorded as their own sources.
  • I have a table of launch-day UTM links and a query that counts signups by source.

Questions

Why store the source on the account and not only in analytics?

Ad blockers and privacy browsers hide a large share of analytics events from technical audiences, which is exactly who launch sites send. A value saved with the account in your own database is not blocked.

Why split out AI assistants?

More and more visitors arrive from ChatGPT, Perplexity, Claude and Gemini. Lumped in with 'referral' you cannot see that channel grow; split out, you can see which answers send you people.

Do I need a cookie banner for this?

That depends on the analytics tool and where your users are. Cookieless tools need less; the prompt tells the agent to respect whatever consent setup you have and to show you any privacy policy change.

Does this prompt add links to Aback Launch to my site?

No. Nothing in the prompt mentions Aback Launch or asks your agent to link to us. The only exception is an optional badge step, which stays off unless you tick it. Some prompt libraries slip their own link into your codebase by default; we think that should always be your choice.

Which coding agents does it work with?

Claude Code, Cursor, Codex, GitHub Copilot, Windsurf, Cline, and any agent that can read your project and edit files. You can copy it as a plain prompt, save it as a Claude Code skill or a Cursor rule, or add it to AGENTS.md.

Is it safe to run on my real codebase?

The prompt makes the agent read first, show a plan and wait for your approval, and it forbids touching secrets, deploying and deleting data. Still review the changes and run your tests before you deploy, as with any change.

Changelog

  • v1.0First version.

Launch your startup on Aback Launch

Get a launch page that search engines and AI assistants can read, a place in the weekly launch list, and a review by a real person. Free to join.