How to Track Promo Codes in Shopify for Creator Campaigns
Shopify makes it easy to create a promo code and hand it off to a creator. The hard part is everything that happens after that. You want to know which creator drove which orders, what the ROAS looks like for each campaign, and whether the customers you acquired are repeat buyers or one-and-done discount hunters. Shopify's native discount reports don't give you any of that.
This guide explains why Shopify falls short for creator attribution, what attribution-grade promo code tracking actually requires, and how to set it up — whether you're working with a custom solution or a dedicated attribution tool.
Why Shopify's Discount Reports Fall Short
Shopify's built-in discount analytics give you a few basic numbers: total discount redemptions, total discount value, and total revenue associated with a code. That's it.
Here's what they don't tell you:
- Which campaign or creator the code belongs to. If you have six creators running
PODCAST10,YOUTUBE15, andNEWSLETTER20, Shopify has no idea those codes map to specific partnerships. You track them by memory or in a spreadsheet. - When conversions happened relative to the campaign. If a creator promoted your brand in January and you see redemptions in March, Shopify gives you no timeline. You can't tell if the code is still being actively promoted or if someone saved it from months ago.
- No ROAS calculation. Shopify shows revenue by discount code, not spend alongside it. You have to manually pull spend from your creator invoices and do the math yourself — and even then, you're only seeing tracked revenue.
- No customer-level attribution. You can't see whether code-using customers were genuinely new or existing customers who gamed the system.
The net result: you're flying blind. You know a creator drove some orders, but you can't compare performance across creators, allocate future budget, or identify your best partnerships.
What Attribution-Grade Promo Code Tracking Requires
Real attribution tracking for creator promo codes needs four things working together:
- Code-to-campaign mapping. Every promo code is linked to a specific campaign, which is linked to a specific creator and ad placement. One code can only belong to one campaign (not shared across placements).
- Order-level attribution. When a customer checks out using a code, that order is stamped with the campaign it belongs to. You can see individual orders, not just aggregate redemption counts.
- Conversion timeline. You need to know when orders came in relative to campaign launch dates, so you can evaluate the attribution window and spot late conversions.
- Spend data alongside revenue. ROAS requires knowing what you paid the creator. This has to be entered somewhere — either in Shopify with a custom app, in a spreadsheet, or in a third-party attribution tool.
Without all four elements, you have data but not attribution.
The Shopify Admin API Approach
If you want to build a custom solution, Shopify's Admin API gives you what you need. The core mechanism is the Order Creation webhook (orders/create).
Here's how it works:
- Set up a webhook to fire every time a new order is created.
- In the webhook payload, Shopify includes a
discount_codesarray on every order. This contains the code used, the type (percentage, fixed amount), and the value. - You capture the code from the webhook and cross-reference it against your code-to-campaign mapping table (stored in your database).
- Stamp the order with campaign metadata and write it to your reporting database.
This approach is technically straightforward if you have a developer. The tricky parts are:
- Building and maintaining the campaign mapping table. Every new creator requires a new code and a new mapping entry. If someone forgets to add a code, that order gets dropped on the floor.
- Handling code sharing and leakage (more on this below).
- Deduplication. Shopify occasionally fires webhooks multiple times for the same order. Your ingestion logic needs to handle this with idempotency keys.
If you don't have developer resources, a purpose-built attribution tool handles all of this natively.
Connecting Discount Codes to Campaigns in Shopify
The cleanest workflow for creator campaign attribution uses one promo code per creator per campaign. Here's the structure:
| Creator | Platform | Code | Campaign | Spend | |---|---|---|---|---| | Jane Smith | Podcast | JANE15 | Q1 Awareness | $2,400 | | Mike Torres | YouTube | MIKE20 | Q1 Awareness | $3,800 | | The Weekly Brief | Newsletter | BRIEF10 | Q1 Newsletter Test | $1,200 |
Each code is unique and owned by exactly one campaign. When orders come in with JANE15, you know exactly which placement drove them. When you sum revenue across all codes in the Q1 Awareness campaign, you get campaign-level revenue.
With Castlytics, this mapping happens automatically. You create a campaign, add a creator, assign a promo code, and enter the spend. Every order that comes in via that code gets attributed to the right campaign. The ROAS is calculated in real time, and you can see it alongside tracking link data and vanity URL traffic.
The Promo Code Leak Problem on Shopify
This is one of the most underappreciated issues in creator attribution: your promo codes will end up on deal aggregator sites.
RetailMeNot, Honey, Rakuten, and dozens of smaller coupon sites scrape and index promo codes. The moment a creator promotes PODPODCAST15 publicly, there's a reasonable chance it gets indexed. Once that happens, customers who found you through Google ads, email, or organic search will also use the code at checkout — because Honey surfaces it automatically.
The result is attribution contamination. Your promo code reports show high redemption volume, but a significant chunk of those orders didn't come from the creator. You're giving the creator credit for revenue that came from other channels.
What to do about it:
- Use tracking links alongside promo codes. When a customer clicks your tracking link and then checks out with the promo code, you have confirmation the code usage is legitimate. If you see high code redemption but low tracking link clicks, you likely have leakage.
- Set code usage limits for testing. For initial campaigns, limit codes to 50–100 uses so they don't get widely indexed before you can evaluate the campaign.
- Monitor code usage patterns. Spikes in redemption on days when the creator didn't publish anything are a red flag.
- Consider vanity URL + code combos. If your vanity URL (
yourbrand.com/creator) only serves the promo code after a visit, you add a friction layer that filters out coupon site users.
You won't eliminate code leakage completely, but you can detect and adjust for it.
Using Discount Code Analytics Alongside Tracking Links
Promo codes and tracking links measure different things. Neither is complete on its own.
Tracking links capture intent — the customer clicked your link from the creator's content. They're accurate for conversion path analysis but miss customers who heard the ad and typed your URL directly.
Promo codes capture behavior at checkout — the customer used the discount. They're accurate for conversion volume but vulnerable to leakage and can't tell you where the customer came from.
The gold standard is to use both:
- Creator includes a tracking link in their show notes, description, or bio.
- Creator verbally mentions the promo code in the content.
- Customers who click the link and use the code are attributed with high confidence.
- Customers who use the code without a prior click are attributed with medium confidence (probably legitimate, but leakage is possible).
- Customers who clicked the tracking link but didn't use the code still get attributed — they paid full price, which is actually better for your margins.
This layered approach gives you a fuller picture of campaign performance than either signal alone.
Shopify Multi-Currency ROAS Calculation
If your store sells in multiple currencies, your ROAS calculation needs an extra step. Shopify records orders in the customer's local currency, and your payouts happen in your store currency. The discount code redemption value in the order is denominated in the order currency, not your reporting currency.
When calculating ROAS:
- Pull order revenue in your store's base currency (Shopify stores this as
presentment_moneyvs.shop_moneyin the order object — useshop_moneyfor reporting). - Make sure your campaign spend is also recorded in your base currency.
- ROAS = total
shop_moneyrevenue from attributed orders ÷ campaign spend.
If you have a creator running campaigns in the UK while your store is USD-based, make sure your spend entry converts the GBP fee to USD at the rate you paid — not the current rate.
Step-by-Step Setup Walkthrough
Here's the practical setup process for creator promo code tracking in Shopify:
Step 1: Create a unique code per creator
In Shopify Admin, go to Discounts > Create discount. Give each code a clear naming convention — [CREATOR_HANDLE][DISCOUNT] works well (e.g., JANESMITH15). Set the discount type, value, and any usage limits.
Step 2: Record the code in your attribution system Whether you're using a spreadsheet, a custom app, or a tool like Castlytics, log the code alongside the creator name, campaign name, campaign start date, and your spend. This mapping table is the backbone of your attribution.
Step 3: Set up order tracking
If you're using Castlytics, the Shopify integration handles this automatically — it reads new orders, checks for promo codes, and attributes them to the right campaign. If you're building custom, set up your orders/create webhook and build the attribution logic on your end.
Step 4: Track alongside your tracking link Create a tracking link for the same campaign. Brief the creator to include both in their content (link in description/show notes, code spoken or displayed).
Step 5: Monitor early signals For the first 72 hours after a campaign goes live, watch daily promo code redemptions. An unusual spike on day one might indicate leakage or an unexpectedly large audience — both worth investigating.
Step 6: Pull ROAS at the campaign level After your attribution window closes (typically 7–30 days), pull total revenue from all orders attributed to the campaign (via code and/or tracking link) and divide by your total campaign spend. That's your measured ROAS.
Common Shopify Attribution Pitfalls
Shared promo codes across creators. If two creators both promote SAVE15, you can't tell whose orders are whose. Always use unique codes.
Missing spend data. Revenue without spend is just revenue. You need spend in the same system as conversions to calculate ROAS.
Wrong attribution window. Creator ads drive delayed conversions — a customer might hear an ad in a podcast, think about it for a week, and then buy. Setting a 1-day attribution window for podcast campaigns will massively undercount conversions. Use a minimum of 7 days, and 14–30 days for podcast or YouTube placements.
Not accounting for existing customers using codes. If a loyal customer uses your creator code, that's probably not an incremental acquisition. If your Shopify integration supports it, filter to new customers only when evaluating acquisition-focused campaigns.
Counting refunded orders. Revenue from orders that later get refunded should be excluded from ROAS calculations. Pull net revenue, not gross.
Key Takeaways
- Shopify's native discount reports show redemption volume and revenue, but don't connect codes to campaigns, creators, or spend — so ROAS is impossible without a separate system.
- True attribution requires a code-to-campaign mapping table, order-level attribution, a conversion timeline, and spend data in the same place.
- Promo code leakage to coupon aggregator sites is real and measurable — use tracking links alongside codes to detect it.
- Multi-signal attribution (tracking link + promo code) is more accurate than either alone.
- Common pitfalls include shared codes, wrong attribution windows, and gross vs. net revenue in ROAS calculations.
Frequently Asked Questions
Can I track Shopify promo codes without a developer? Yes. Tools like Castlytics integrate with Shopify via API and handle the code-to-campaign mapping automatically. No custom code required.
How many promo codes should I create per campaign? One unique code per creator per campaign. Never share a code across multiple creators or placements — you lose attribution entirely.
What's a good attribution window for creator promo codes? 7 days minimum. For podcast and YouTube, 14–30 days captures the majority of delayed conversions. Shorter windows will undercount, making campaigns look worse than they are.
How do I handle promo code leakage? Monitor for unusual redemption spikes on non-launch days, cross-reference against tracking link clicks, and consider limiting initial code usage. No solution eliminates leakage completely, but you can detect and adjust for it.
If you're running creator campaigns on Shopify and want to connect promo codes to campaigns automatically, Castlytics has a native Shopify integration that syncs orders, discount codes, and spend data in one place. The free tier supports up to three campaigns — enough to start measuring what you're already spending on creators.
Ready to track your podcast ad ROI?
Castlytics gives you per-campaign attribution, real-time ROI, and listener journey analytics — free to get started.
Start free — no credit card