No black box. Full transparency.

How Castlytics Works

From campaign creation to revenue attribution — here's exactly what happens under the hood across podcasts, YouTube, Instagram, TikTok, and influencer campaigns.

1

Create a campaign for any creator

In Castlytics, you create one campaign per creator placement. You select the channel type (podcast, YouTube, Instagram, TikTok, influencer, or custom), add the creator's name, and enter the URL you want visitors to land on.

Castlytics generates a short tracking link automatically — something like castlytics.app/r/abc123. But you have three link options depending on your plan and setup:

  • Castlytics linkcastlytics.app/r/abc123. Auto-generated, works immediately, available on all plans. Best for getting started fast.
  • Custom tracking domainlinks.yourbrand.com/tim. Your own subdomain pointing to Castlytics via a DNS CNAME record. Available on Starter and above. What serious advertisers use because the URL reflects their brand.
  • Vanity path (first-party)yourbrand.com/tim. No redirect at all — your tracker script detects the path when the visitor lands. The gold standard for podcast and creator ads.

You can also add a promo code (e.g. TIM10) as a third signal — it captures conversions where the listener never clicked a link or typed a vanity URL.

Big advertisers rarely use a third-party redirect URL in their spoken CTA — they say "go to brand.com/tim" or "use code TIM10". Castlytics supports all of these, so your tracking setup matches how real creator ads are actually delivered.
2

Install the tracking script on your website

Add one line of JavaScript to your website's <head> tag:

<script src="https://castlytics.app/tracker.js" data-key="YOUR_PUBLIC_KEY" async></script>

That's it. The script is tiny, loads asynchronously (so it never slows your site), and immediately starts doing three things:

  • Assigns a visitor ID — a random UUID stored in a first-party cookie called _cly_vid. This is anonymous and contains no personal information.
  • Records page views — every page the visitor navigates to is logged, so you can see the full journey from ad touch to purchase.
  • Detects vanity paths — on each page load, the script checks if the current URL matches any of your campaign vanity paths and fires a campaign_landing event automatically. No per-page configuration needed.
⚠️ Vanity path requirement: The path (e.g. /tim) must be a real page on your site — one where the tracking script loads before any redirect fires. If your server issues a 301 redirect for /tim before the page renders, the script will never see the path. The simplest fix: create a landing page at that slug (a WordPress page, for example), or use client-side routing. Server-side 301s and vanity path detection are incompatible.
About your public key: The data-key in the script tag is safe to include in your page source. It identifies your workspace for incoming tracking events only — it cannot read your dashboard data, access campaigns, or generate API tokens. If someone copied your key, the worst they could do is send fake visitor events to your workspace, which you would see as anomalous traffic spikes and could ignore.
Castlytics does not use third-party cookies, does not fingerprint browsers, and stores no personally identifiable information. The visitor ID is a random string tied to a session — nothing more.
3

A visitor arrives via any attribution signal

Castlytics captures visitors through four distinct signals — each one links an anonymous visitor to the right campaign:

🔗 Tracking link

castlytics.app/r/abc123 — a short redirect link generated automatically for every campaign. Paste it in show notes, video descriptions, or bio links. On Starter and above you can use your own domain (links.yourbrand.com/tim) via a DNS CNAME.

🌐 Vanity path

yourbrand.com/tim — no redirect at all. The tracker script detects the path when the visitor lands and fires the attribution event. Ideal for podcast and audio ads where listeners type the URL directly.

🏷️ Promo code

Visitor uses the promo code at checkout without ever clicking a link. The code is matched to the campaign at conversion time — catches listeners who heard the ad but came back later.

💬 Post-purchase survey

"How did you hear about us?" — an optional widget on your order confirmation page captures conversions all other signals miss, like word-of-mouth or audio ads the listener didn't click.

The visitor's anonymous ID is now linked to the campaign in Castlytics's database. From this moment, their journey is tracked within the campaign's attribution window.

4

The visitor browses your site

As the visitor moves around your site, each page view is recorded against their visitor ID. This builds the journey you'll later see in your analytics — a sequence like:

🎙 Creator Ad//features/pricing/signup✓ Converted

This is collected purely from the page views the script records — there's no tracking of what the visitor types, clicks within a page, or does outside your site.

5

Record a conversion

A conversion is recorded when a visitor completes a goal — a purchase, a signup, a lead form. You trigger this by calling Castlytics from your confirmation page or checkout webhook:

// On your order confirmation page or via server-side API
fetch("https://castlytics.app/api/conversions", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    publicKey: "YOUR_PUBLIC_KEY",
    visitorId: window._cly_vid,   // auto-set by tracker
    type: "purchase",             // purchase | signup | lead
    revenue: 49.00,               // optional: order value
    currency: "USD",
    promoCode: "TIM10"            // optional: triggers promo attribution
  })
})

The visitorId is automatically available as window._cly_vidafter the tracking script loads. On server-side integrations, read the _cly_vid cookie directly. Including promoCode activates promo code attribution as a third signal alongside link and vanity path detection.

⚠️ Ad-blockers and client-side fetch: The JavaScript snippet above is easy to add but may be silently blocked by privacy extensions (uBlock Origin, Privacy Badger, etc.) — particularly on domains containing words like "track" or "lytics". For paid conversions where 100% accuracy matters, use a server-side API call from your checkout webhook instead. The endpoint and payload are identical — the only difference is the request originates from your server, where ad-blockers have no reach. Read the _cly_vid cookie from the session server-side and include it as visitorId.

Using Shopify or WooCommerce? WooCommerce users: install the free Castlytics WordPress plugin — it handles the script injection and order tracking automatically, server-side, no JavaScript integration needed. Shopify users: connect your store under Settings → Integrations. Orders are imported automatically and coupon codes are matched to campaigns — no custom code required.

6

Attribution is calculated

When a conversion arrives, Castlytics looks back at all creator campaign touches for that visitor within the campaign's attribution window and assigns revenue credit based on your chosen model. Note: attribution is scoped to your tracked creator campaigns — not to Google, Meta, or organic traffic.

First Touch

100% credit to the first ad touch the visitor had. Best for understanding which creators introduce your brand.

Last Touch

100% credit to the most recent ad touch before conversion. Best for understanding which creators close sales.

Equal Split

Credit split equally across all creator campaign touches. Best for a balanced view when a customer encountered multiple creators.

A touch can be a click, a vanity path visit, or a promo code match. The key rule: a promo code is only added as an attributed touch if no click or vanity path was already recorded for that visitor. This prevents double-counting across all three attribution models — including Equal Split. If a visitor both clicked your tracking link and used your promo code at checkout, only the click is counted as the touch; the promo code doesn't add a second credit. Promo code attribution is truly a last resort, not an additional signal layered on top.

You can switch between models at any time — no data is lost. The attribution window is configurable per campaign, from 7 to 60 days depending on your plan.

All attribution is calculated in real time as conversions arrive. Your ROI dashboard updates automatically — no batch jobs, no waiting.
7

Go deeper: understand true incrementality

Attribution tells you which campaigns received credit for conversions. Incrementality tells you which campaigns actually caused them. The difference matters: a visitor might have converted through a Google search regardless of hearing your podcast ad. Attribution would credit the campaign; a true incrementality test would not.

In theory, the right way to measure this is a holdout test — show the ad to 80% of an audience, hold back 20%, and compare conversion rates. In practice, creator marketing makes this hard: you cannot control who hears a podcast episode or watches a YouTube video. The creator publishes to their whole audience at once.

What you can do with Castlytics data is a practical approximation:

📊 Attributed CVR (from Castlytics)

Visitors who came through your campaign link, vanity path, or promo code. This is your 'exposed' group — people who demonstrably encountered and responded to the ad.

📈 Baseline CVR (from your analytics)

Your overall site conversion rate during the same period, excluding attributed visitors. This is the closest proxy to an organic baseline — people converting with no campaign signal.

The gap between these two rates gives you a directional signal of lift:

Attributed CVR: 4.2%Baseline CVR: 2.8%=~1.4% lift signal

This is an approximation, not a controlled experiment — the attributed group is self-selecting (people who clicked a link are already more interested than average). For a more rigorous test, teams typically pair this with a geographic holdout (run the campaign in one market, use a comparable market with no campaign reach as the control) or a dark period test (pause the campaign for one month and observe the drop in overall site conversions).

Castlytics is an attribution tool, not an experimentation platform. It gives you the campaign conversion data that forms the "exposed" side of an incrementality analysis. The baseline and experimental design come from your broader analytics setup. Used together, they get you much closer to a causal answer than attribution alone.

Common questions

Does Castlytics use cookies?

Yes — one first-party cookie called _cly_vid stores the visitor's anonymous random ID. It contains no personal data. There are no third-party cookies and no cross-site tracking.

What if a visitor doesn't click the tracking link?

No problem — the tracking link is just one of four signals. Castlytics also captures vanity path visits (visitors who type yourstore.com/pod20 directly into their browser after hearing an ad), promo code usage at checkout (listeners who come back days later without clicking anything), and post-purchase survey responses ("How did you hear about us?" on your confirmation page). Using all four signals together maximises attribution coverage — especially important for audio and video ads where viewers don't always click in real time.

Can the same visitor be attributed to multiple campaigns?

Yes — if a visitor touched ads from two different campaigns, both campaigns will have that visitor in their touch data. Depending on your attribution model: Last Touch credits the most recent campaign, First Touch credits the first, and Equal Split divides credit equally across all creator campaigns touched.

How does vanity path detection work?

When your tracking script loads, it fetches a lightweight map of all your active campaign vanity paths. On every page view, it checks if the current URL matches one of those paths. If it does, a campaign_landing event is fired automatically — no extra code needed on those pages. Important: the path (e.g. /tim) must be a real page where the script can load. Server-side 301 redirects on that path will prevent the script from ever firing. Create an actual landing page at the vanity slug, or use client-side routing.

How accurate is the attribution?

Castlytics captures significantly more conversions than vanity URL or promo code methods alone because it combines all four signals. However, visitors who use multiple devices or block cookies won't be fully tracked — no attribution system is 100% complete.

Is the tracking script GDPR compliant?

The script stores only an anonymous first-party visitor ID — no name, email, IP address, or any personally identifiable information. For most interpretations of GDPR, anonymous analytics cookies don't require consent. You should consult your own legal counsel for your specific jurisdiction.

Can I use Castlytics without a developer?

For click tracking and vanity path attribution, yes — paste one script tag and you're done. Recording conversions requires a small integration on your confirmation page or a server-side API call, which typically takes a developer 30 minutes to implement.

What's the difference between attribution and incrementality?

Attribution assigns credit for conversions to campaigns based on observed touchpoints (clicks, vanity paths, promo codes). Incrementality measures how many of those conversions genuinely wouldn't have happened without the campaign. A visitor might have converted organically regardless of seeing the ad — attribution credits the campaign anyway, but an incrementality test (using a holdout group) would filter that out. Attribution answers 'which campaign got credit?'. Incrementality answers 'which campaign actually caused the conversion?'.

Can Castlytics run a proper holdout/incrementality test?

No — Castlytics is an attribution tool, not an experimentation platform. It gives you the campaign conversion data (the 'exposed' side). Because creator ads are published to an entire audience at once, you can't randomise who sees them the way you can with paid social. Practical incrementality approaches for creator marketing include geographic holdouts (comparing a market where the creator has reach vs. one where they don't) or dark period tests (pausing the campaign for a month and measuring the drop in overall conversions). Castlytics data feeds the exposed side of those analyses.

What is the post-purchase survey and how does it work?

The post-purchase survey adds a 'How did you hear about us?' widget to your order confirmation page. When a visitor answers, Castlytics automatically tries to match their answer to one of your campaigns using the campaign name, creator name, handle, or promo code. It captures conversions that link clicks and vanity paths miss — especially useful for podcast ads or word-of-mouth where listeners don't always click in real time. Enable it under Settings → Post-Purchase Survey.

Can Castlytics integrate with my Shopify or WooCommerce store?

Yes. Connect your store under Settings → Integrations and Castlytics will automatically import orders as conversions. Coupon codes on orders are matched to campaigns that have a matching promo code configured. You can sync the last 30 days manually on demand, or set up a webhook URL in your store to ingest new orders in real time. Once connected, campaign detail pages also show customer quality metrics: refund rate and repeat buyer rate.

Do I need to add code to my Shopify or WooCommerce store to track conversions?

No — with the Shopify or WooCommerce integration, conversions are imported automatically from your order data. You don't need to add the castlytics.conversion() call to your store's confirmation page unless you also want to track non-order events like signups or lead forms.

Ready to get started?

Free plan includes 3 campaigns, unlimited clicks, and 30-day attribution.

Create free account →