The last-mile signal. The one that closes the loop.

Promo Code Attribution

When a listener uses TIM10 at checkout three days after hearing a podcast, Castlytics knows it came from Tim's show. Automatic campaign matching, no JavaScript on the checkout page required.

Why promo code attribution matters

Podcast listeners can't click links while driving. Many convert days later. Promo codes are the signal that ties those delayed conversions back to the right show.

🎙

Audio-only placements

The listener can't click a link in a podcast. The host says 'use code TIM10 for 20% off'. Three days later the listener buys. Without promo code attribution, that sale shows as organic.

Delayed conversions

Research shows podcast listeners often convert days after hearing an ad. Cookie-based attribution windows expire or get cleared. A promo code at checkout is the reliable final signal.

📱

Cross-device journeys

Heard the ad on iPhone, bought on laptop. No cookie to bridge the sessions. But the promo code travels with the listener across devices and days.

🏷️

Creator-specific codes

Give each creator their own code (TIM10, SARAH15, MARCUS20). Castlytics maps each code to a campaign automatically — no manual matching needed.

No double-counting. Smart attribution priority.

Castlytics uses a signal hierarchy so a visitor is never credited twice.

1st

Click attribution

Visitor clicked the tracking link. This is the strongest signal. Promo code is ignored.

2nd

Vanity path

Visitor typed yourbrand.com/tim directly. No click was recorded. Promo code is still ignored.

3rd

Promo code

No click, no vanity path. Visitor used TIM10 at checkout. Campaign gets the attribution.

Promo code attribution only fires when no higher-priority signal was recorded.

🛍️

Works with Shopify — no code required

Connect your Shopify store under Settings → Integrations. Castlytics imports your orders and automatically matches Shopify discount codes to campaigns. No checkout page JavaScript. No developer needed.

1

Connect Shopify

Enter your shop URL and Admin API token. One-time setup.

2

Sync orders

Castlytics imports the last 30 days of orders and matches discount codes to campaigns.

3

See revenue per creator

Campaign dashboards show revenue, ROAS, and refund rate from Shopify data.

Recording a promo code conversion

Not using Shopify? Trigger promo attribution with one extra field in your conversion call.

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",
    revenue: 79.00,
    currency: "USD",
    promoCode: "TIM10"             // ← triggers promo attribution
  })
})

If window._cly_vid is present and already linked to a click or vanity path visit, the promo code is noted but click attribution takes precedence.

Promo code attribution questions

Does promo code attribution cause double-counting?

No. Promo code attribution only fires if no click or vanity path was already recorded for that visitor. Castlytics uses a strict priority hierarchy — click first, then vanity path, then promo code — so a visitor is never attributed twice.

What if multiple campaigns use the same promo code?

Promo codes should be unique per campaign. Castlytics matches on the campaign's configured promo code, so if two campaigns share the same code, you'd get ambiguous results. Best practice: give each creator or show a unique code.

Can I track promo codes without the tracking script?

Yes — if you're using the Shopify integration, discount codes are imported from your orders automatically with no script required. For non-Shopify stores, you need to include promoCode in your conversion API call, but the tracker script itself is only needed for click and vanity path tracking.

Does promo code attribution work with delayed conversions?

Yes. This is exactly what promo codes are best at. A listener might hear a podcast on Monday and buy with the code on Friday. As long as the promo code is included in the conversion API call (or imported from Shopify), Castlytics will attribute it to the right campaign regardless of how much time has passed.

What's the difference between promo code attribution and vanity URL tracking?

Vanity URL tracking captures the visitor when they arrive at your site — it fires when they land on yourbrand.com/tim. Promo code attribution captures them at checkout — it fires when they use TIM10. Vanity paths are stronger because they establish the visit earlier; promo codes are more reliable for delayed conversions where the visitor's session has expired.

Start attributing promo code sales

Free plan includes 3 campaigns with promo code tracking. No credit card required.

Create free account →