Implementation GuidesBeginnerUpdated June 25, 2026

Install AttribIQ

Add the web tracker, pass attribution metadata into checkout, and send revenue events through Stripe webhooks or the Payment API.

TL;DR

Install the tracker first, then pass the browser attribution object into checkout. Stripe users should copy AttribIQ identifiers into Checkout and Subscription metadata; custom billing systems can send normalized revenue events through the Payment API.

What you will learn
  • Install the AttribIQ web tracker
  • Capture the browser attribution object before checkout
  • Choose Stripe metadata or the generic Payment API
  • Run revenue reports from the dashboard or CLI

Install AttribIQ in two stages: collect web analytics first, then connect payments.

The tracker records visits, sessions, sources, referrers, UTM campaigns, pages, and goals. The payment integration connects those sessions to purchases, subscriptions, renewals, refunds, and churn.

Add the web tracker

Place the tracker on pages where visitors arrive, evaluate the product, sign up, or start checkout.

<script async src="https://edge.attribiq.com/i/a7K4mN2qR8tP.js"></script>

Use the project-specific script URL from your AttribIQ project settings. The install key in the URL maps browser events to your project.

If you want the browser to load the tracker from your own domain, use a first-party tracker proxy and proxy both the script path and the event endpoint.

Content Security Policy

If your site uses Content-Security-Policy, merge the AttribIQ edge origin into the page's existing directives.

script-src 'self' https://edge.attribiq.com;
connect-src 'self' https://edge.attribiq.com;

The direct tracker loads JavaScript from https://edge.attribiq.com and sends events back to https://edge.attribiq.com. It does not require unsafe-inline, unsafe-eval, or an AttribIQ img-src origin.

AttribIQ cannot override a customer's CSP from the edge domain. The browser evaluates the page owner's policy before fetching the tracker script.

For nonce-based policies, add the page's nonce to the external script tag and keep the same nonce in the CSP header:

<script nonce="RANDOM_NONCE" async src="https://edge.attribiq.com/i/a7K4mN2qR8tP.js"></script>

With a first-party proxy, the browser-facing CSP usually only needs your own origin for the tracker paths, because the server-side proxy forwards requests to AttribIQ.

Capture attribution before checkout

When checkout starts, read the attribution object from the browser and send it to your backend.

const attribution = window.attribiq.getAttribution()

await fetch("/api/create-checkout-session", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    price_id: "price_123",
    attribution
  })
})

The browser should not create payment sessions directly. It only passes context to your server.

Connect Stripe

Stripe users should copy AttribIQ identifiers into Checkout Session metadata and Subscription metadata. After that, either configure Stripe to send webhooks directly to AttribIQ or send normalized revenue events from your own backend through the Payment API.

await stripe.checkout.sessions.create({
  mode: "subscription",
  client_reference_id: attribution.visitor_id,
  metadata: {
    attribiq_project_id: attribution.project_id,
    attribiq_visitor_id: attribution.visitor_id,
    attribiq_session_id: attribution.session_id
  },
  subscription_data: {
    metadata: {
      attribiq_project_id: attribution.project_id,
      attribiq_visitor_id: attribution.visitor_id,
      attribiq_session_id: attribution.session_id
    }
  }
})

Read how to pass attribution to Stripe Checkout for the metadata pattern, then connect Stripe to AttribIQ for the webhook setup.

Send custom revenue events

If you use a custom payment system, send revenue events through the Payment API.

POST /v1/revenue
Authorization: Bearer sk_project_...
Idempotency-Key: txn_123
Content-Type: application/json
{
  "provider": "custom",
  "transaction_id": "txn_123",
  "event_type": "purchase",
  "amount": 2900,
  "currency": "EUR",
  "visitor_id": "v_abc",
  "session_id": "s_def",
  "metadata": { "plan": "builder" }
}

Read the Payment API reference for fields, event types, and idempotency rules.

Query reports from the CLI

Use the CLI when you want revenue reports in scripts, release checks, or automation.

attribiq revenue --project proj_123 --from 30d --group-by campaign --json
attribiq overview --project proj_123 --from 90d --json
attribiq funnels inspect signup-to-paid --project proj_123 --json

Read CLI reports for the first commands to support.

Next steps

After the tracker is installed, wire one payment path end to end. For Stripe, use Stripe metadata and connect Stripe to AttribIQ. For custom billing or a customer-owned Stripe relay, use the generic Payment API revenue tracking guide.

FAQ

What is the fastest install path?

Add the web tracker, confirm pageviews arrive, then wire checkout attribution. Stripe users should start with Checkout metadata and webhooks.

Do I need Stripe?

No. Stripe is the first native payment integration, but the generic Payment API can accept normalized revenue events from custom billing systems and other providers.

Should the tracker run on the marketing site or app?

Install it wherever attribution-relevant sessions happen: marketing pages, pricing pages, guides, signup pages, and app pages that can lead to checkout.

Can I install the tracker without revenue events?

Yes. The tracker provides the analytics base layer. Revenue reports become useful once Stripe webhooks or Payment API events are connected.

Connect payments to the dashboard

Install the tracker, pass attribution into checkout, and report revenue by source, campaign, landing page, and path.

Related guides