ORIGINAL REDDIT POST

How to block internal discount codes if a customer lands via an affiliate tracking link

Hi everyone, I’m running into a frustrating issue with affiliate link tracking and my internal discount codes on Shopify, and I’m looking for a workaround or app recommendation. Here is my setup: I use an affiliate app (GoAffPro) where my affiliates use…

Original postr/shopify

Hi everyone, I’m running into a frustrating issue with affiliate link tracking and my internal discount codes on Shopify, and I’m looking for a workaround or app recommendation. Here is my setup: I use an affiliate app (GoAffPro) where my affiliates use strictly referral links (e.g., store.com/?referral=ABC). They do not use text-based discount codes. I also run internal marketing campaigns using my own manual and automatic discount codes created within Shopify. The problem: If a customer clicks an affiliate link and lands on my site, I want them to buy through that affiliate so the affiliate gets their rightful commission. However, if that customer tries to manually enter one of my internal marketing discount codes at checkout, Shopify currently allows it to go through. I want to completely block my Shopify discount/automatic codes from working at checkout IF the customer arrived via an affiliate link. I don't want to just set a "0% commission rule" in GoAffPro, because I want my affiliate to get paid for that referral. I just want my internal codes to say "Invalid" or be rejected at checkout because the referral link is active. It'll also be weird if I set a 0% discount code linked to that affiliate link because customers will see a 0% discount at checkout. How can I bridge this gap? Any advice would be greatly appreciated. Thanks in advance!

Collected discussion

23 comments

u/zakkvgoodiez

GoAffPro actually allows for discount codes to be used, you just have to generate the codes via shopify and then import them into the commissions tab. You can use an app like Cart Lock or Checkout Blocks to create a rule: GoAffPro tracks referrals via cookies. You will need to add a tiny bit of Javascript to your theme to push that cookie into a "Cart Attribute" (e.g., Affiliate = Active). Set the app to look for that specific Cart Attribute. If the attribute is present AND a customer tries to apply a discount code, the app intercepts the checkout. The customer is prevented from paying, and a red error message of your choosing appears (e.g., "Promo codes cannot be combined with affiliate referrals. Please remove the promo code to proceed."). The other option is to force all of the affiliates to run a link that puts a different code in like $1 off, or free shipping as the discount and make that code not stackable with your current marketing coupon codes. Both are kind of janky, both have their ups and downs, and both are prone to weird glitches or failures based on your other javascript that's running. People can circumvent both options by hammering through checkout and then pressing back and entering their own code (from my own testing at least) or if they know how to apply discount codes via links

u/[deleted]

This comment was deleted.

u/AutoModerator

Your comment in r/shopify was automatically removed as your 'post' karma is below 10 (we do not consider your total karma; your post and comment karma are separate numbers and must both meet their minimum requirement). You can increase your post karma by posting in other areas of Reddit to earn upvotes. The higher quality the content, the higher your karma will become. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

u/[deleted]

This comment was deleted.

u/AutoModerator

Your comment in r/shopify was automatically removed as your 'comment' karma is below 20 (we do not consider your total karma; your post and comment karma are separate numbers and must both meet their minimum requirement). You can increase your comment karma by posting in other areas of Reddit to earn upvotes. The higher quality the content, the higher your karma will become. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

u/AutoModerator

Your comment in r/shopify was automatically removed as your 'comment' karma is below 20 (we do not consider your total karma; your post and comment karma are separate numbers and must both meet their minimum requirement). You can increase your comment karma by posting in other areas of Reddit to earn upvotes. The higher quality the content, the higher your karma will become. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

u/AutoModerator

Your comment in r/shopify was automatically removed as your 'post' karma is below 10 (we do not consider your total karma; your post and comment karma are separate numbers and must both meet their minimum requirement). You can increase your post karma by posting in other areas of Reddit to earn upvotes. The higher quality the content, the higher your karma will become. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

u/AutoModerator

Your comment in r/shopify was automatically removed as your 'post' karma is below 10 (we do not consider your total karma; your post and comment karma are separate numbers and must both meet their minimum requirement). You can increase your post karma by posting in other areas of Reddit to earn upvotes. The higher quality the content, the higher your karma will become. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

u/AutoModerator

Your comment in r/shopify was automatically removed as your 'post' karma is below 10 (we do not consider your total karma; your post and comment karma are separate numbers and must both meet their minimum requirement). You can increase your post karma by posting in other areas of Reddit to earn upvotes. The higher quality the content, the higher your karma will become. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

u/AutoModerator

Your comment in r/shopify was automatically removed as your 'post' karma is below 10 (we do not consider your total karma; your post and comment karma are separate numbers and must both meet their minimum requirement). You can increase your post karma by posting in other areas of Reddit to earn upvotes. The higher quality the content, the higher your karma will become. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

u/BTWigley

checkout validation that blocks staff codes when a referral parameter is present beats fighting it inside the affiliate tool. Tell affiliates the stack is intentional

u/[deleted]

This comment was deleted.

u/afakevc

This app Vigilance https://apps.shopify.com/vigilance blocked injected codes from honey, wikibuy etc and sends alerts when you coupon codes get leaked

u/HoneyedVices

the only clean way is writing the referral into a cart attribute when they land, then having a discount function reject codes when that attribute exists. that's plus territory though. if you're not on plus most people just accept the overlap and make the internal codes narrow enough that affiliate traffic isn't likely to have them anyway

u/yyyogev

You can do this with a custom function that checks for the affiliate referral cookie and turns off the internal codes when it's there. I wouldn't trust discount apps after the Honey scam.. a custom script stays cleaner than stacking more apps. On Plus you'd use Scripts, otherwise a checkout function handles it

u/abuiles

I have a recipe to solve a similar issue using https://tenderprompt.com, ping me. I’ll personally get you setup and give you a three months trial. No strings attached.

u/[deleted]

This comment was deleted.

u/[deleted]

This comment was deleted.

u/[deleted]

This comment was deleted.

u/[deleted]

This comment was deleted.

u/[deleted]

This comment was deleted.

u/[deleted]

This comment was deleted.

u/[deleted]

This comment was deleted.