Affixo install tracking
Skill wizardsofsocial/affixo-dev/skills/affixo-install-tracking
Install and verify Affixo affiliate tracking in a web app. Load this skill BEFORE adding referral tracking, an affiliate/partner program, or commission attribution to a codebase — and whenever a task mentions Affixo, sa.js, window.Affixo, a tracking snippet with a ?w= public key, or crediting a referrer for a signup or sale. Covers the three events (click, signup, sale), the Stripe checkout attribution step that decides whether an affiliate is paid at all, and how to verify the install actually fired. Also load it when diagnosing a program that records sales but credits nobody, attribution that works in testing but not in production, or subscription renewals that stop being attributed after the first payment.From its SKILL.md
npx -y skills add wizardsofsocial/affixo-dev --skill affixo-install-trackingAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
6.1 KB, as published. Nobody here has run it
Affixo install tracking
Affixo credits an affiliate when someone they referred signs up or buys. Three things have to be true for that to work, and the third is the one that silently fails.
Before you start — get these two from the merchant
- The workspace public key (
pk_…). It is in the Affixo app under Settings → Tracking & install, and it is already embedded in the prompt that sent you here. Without it the script cannot resolve the workspace and attribution fails silently on every page. - How they take payment. This decides STEP 4 and there is no safe default — the mechanism for a server-created Checkout Session does nothing on a Buy Button. Ask if you cannot tell from the code.
If either is missing, ask. Do not guess a key, and do not assume Stripe Checkout Sessions because they are the most common.
STEP 1 — the tracking script
Add it to the site <head> or the root layout so it loads on every route.
A snippet that only runs on some pages loses the referral on the others.
<script async src="https://go.affixo.dev/sa.js?w=PUBLIC_KEY"></script>
Next.js App Router — app/layout.tsx:
import Script from 'next/script'
<Script async src="https://go.affixo.dev/sa.js?w=PUBLIC_KEY" strategy="afterInteractive" />
The script captures the referral click by itself: it reads ?ref=, ?via=,
?am_id=, ?fpr= and similar parameters and stores a visitor id. You do not
write any click-tracking code.
GoHighLevel is different — one tag, no per-page code. See references/gohighlevel.md.
STEP 2 — the signup event
Fire once, immediately after a successful signup:
window.Affixo?.track('signup', { email: USER_EMAIL });
Use the real signed-in email. A placeholder breaks identity matching and the referral can never be reconciled. If signup completes server-side, fire this on the first authenticated page load instead.
STEP 3 — the sale event
Fire once on the post-payment success page:
window.Affixo?.track('sale', {
email: BUYER_EMAIL,
amount: ORDER_TOTAL, // MAJOR units — see the warning below
currency: 'usd', // the 3-letter code you actually charged
order_id: ORDER_ID, // stable, so a refresh cannot double-count
});
amountis in MAJOR units — dollars, not cents. A $99.00 order is99.00. Sending9900records a $9,900 sale and pays a commission ~100× too large. This is the single most expensive mistake in an Affixo install, and it is invisible until a payout is calculated. Most payment APIs (Stripe included) give you cents — divide by 100.
STEP 4 — checkout attribution (the one that fails silently)
The sale event alone is not enough. Affixo confirms revenue from the merchant's connected Stripe account, and Stripe's webhook can only credit the referring affiliate if the checkout itself carries the Affixo visitor id.
Skip this and everything looks fine: the sale is recorded, the dashboard shows revenue, and no affiliate is ever paid. Nothing errors.
Read the file for the merchant's checkout surface and apply only that one:
| Their checkout | Reference |
|---|---|
Server creates the session (stripe.checkout.sessions.create) | checkout-sessions.md |
A buy.stripe.com Payment Link | payment-links.md |
<stripe-buy-button> embed | buy-button.md |
<stripe-pricing-table> embed | pricing-table.md |
| GoHighLevel funnel or order form | gohighlevel.md |
| No HTML access — installing via GTM | google-tag-manager.md |
| Not sure | Inspect the code first; if still unclear, ask |
The visitor id comes from window.Affixo?.getVisitorId() and only exists on the
client, after the script has loaded.
Verify before you call it done
- The script tag is present on every route of the built output, not just the page you edited.
- Visit the live site through a referral link (
?ref=TESTCODE) and confirm a click is recorded in Affixo under Settings → Tracking & install → Integration testing. - Run a test signup and confirm the referral appears.
- Confirm the checkout carries the visitor id — this is STEP 4, and it is the part most likely to be missing.
A localhost-only test proves the code runs, not that the install works: Affixo
deliberately does not count hits from localhost, 127.0.0.1, ::1 or
0.0.0.0 as a live install. Deploy, then verify.
Rules
- The script must load on every page.
- Real emails only, never placeholders.
amountin major units;currencyas actually charged.- A stable
order_id, so a refresh or retry cannot double-count. - Do not add any other analytics or tracking code — you were asked for this one.
- Do not invent config values. Ask for anything you do not have.