Skip to main content
All Collections3rd Party Integrations
Referral Program Discounts Integration with ReCharge
Referral Program Discounts Integration with ReCharge
Samantha avatar
Written by Samantha
Updated over 5 years ago

For companies on the ReCharge/Shopify ecosystem, Friendbuy can easily be integrated to provide a frictionless experience for consumers engaging in your referral program. Wether your referral program is a single-sided or double-sided offer, Friendbuy can automatically distribute ReCharge codes to referred Friends and Advocates for discounts off subscription products.

Before you get started, let’s make sure you have the basics covered for your referral program. Check out Friendbuy’s Getting Started with 6 Steps article if you’re setting up your program for the first time. Once you’re ready to add codes to Friendbuy, you’ll want to follow these four steps.

Step 1: Creating bulk discount codes in ReCharge 

Creating a large volume of discount codes in ReCharge can be accomplished in two ways. You can either use the ReCharge API or ask the ReCharge Support team to create them for you. For the latter, please contact support@rechargeapps.com with a description of the request.

In addition to configuring your discounts codes with the appropriate fixed amount or percentage off, here are some items to keep in mind when creating discount codes:

  • We suggest naming discount codes with a convention that can be used to easily identify to whom they will be distributed: an Advocate or Friend. For example, use an “ADV” and “FRN” prefix, respectively.

  • Make sure to apply usage limits so that each discount code can only be used by one customer, for one subscription, for a single charge.

  • Friendbuy will notify you via email if you’re running low on codes. However, we suggest you create enough to last at least a three months.

For a complete guide to ReCharge discount codes and all of the options, please refer to the ReCharge discounts documentation.

Step 2: Adding your ReCharge discount codes to Friendbuy

To complete this step, you must have CSV or TXT files that contain the discount codes created in ReCharge. 

  • If you’re using the the ReCharge API, you can call the List Discounts endpoint to retrieve a list of codes.

  • If the ReCharge support team created the discount codes for you, they’ll send you a CSV once the codes have been added or you can download a discounts export from the reports page in Recharge.

Once you have your discount code files handy, you’ll want to create code banks in Friendbuy for both Advocates and Friends and upload each respective discount code file. For detailed instructions about creating code banks and uploading codes, please check out this Friendbuy help article.

Step 3: Enabling referred Friends to apply their discount code to subscriptions

You’re in luck, there is nothing to configure here! Referred Friends can simply apply their discount code on the ReCharge checkout page for a discount toward their new subscriptions. 

Step 4: Enabling Advocates to apply their discount code to an existing subscription

Advocates can redeem their reward by accessing the ReCharge Customer Portal and applying their discount code to one of their Subscriptions. Note, this option is not enabled in ReCharge by default. To turn it on, login into your ReCharge dashboard then navigate to Settings > Customer Portal > Discounts, then enable the “Allow customers to input discount code on customer portal” option.

Note, ReCharge allows only one discount code to be applied to a subscription at a time. If an Advocate earns multiple rewards through the referral program in a given month, they can apply that discount to their next recurring subscription when that period hits.

For the best user experience, we recommend adding a sentence or two to your Friendbuy Advocare Reward Email template that describe how they can redeem their discount code.  Here is an example you’re free to use.

“When you’re ready to cash in on your reward, simply login to your account, click on Subscriptions, and add your code into the Apply Discount Code field. We’ll then automatically apply the discount towards your next subscription!”

Step 5: Install Friendbuy Conversion Tracking code on Recharge checkout

Since referred friends will be checking out on a ReCharge hosted page, you'll need to install Friendbuy's conversion tracking code to ensure you're capturing referral conversions. 

Copy and paste the below code in Settings > Checkout > Thank you page > Additional scripts and trackers. Be sure to replace the site ID ('xxxxx' below) with your site ID from the Integration Code section in your Friendbuy account. 

<script>
          window['friendbuy'] = window['friendbuy'] || [];
          window['friendbuy'].push(['site', 'xxxxx']);
          window['friendbuy'].push(['track', 'customer',
              {
               id: '{{ customer.shopify_customer_id }}',
               email: '{{ email }}',
               first_name: '{{ first_name }}',
               last_name: '{{ last_name }}'
              }]);
          window['friendbuy'].push(['track', 'order',
              {
               id: '{{ order_number }}',
               amount: '{{ total_price }}'.replace(/[$,]+/g,""),
               coupon_code: '{{ discount_code }}',
               email: '{{ email }}'
              }
              ]);
          (function (f, r, n, d, b, y) {
              b = f.createElement(r), y = f.getElementsByTagName(r)[0];b.async = 1;b.src = n;y.parentNode.insertBefore(b, y);
          })(document, 'script', '//djnf6e5yyirys.cloudfront.net/js/friendbuy.min.js');
</script>

Support for a la carte products in addition to subscription

If you want to provide discounts off a la carte products as part of the offer structure for your Friendbuy referral program, you’ll also need to create the same discount codes in Shopify.  You can learn more by checking out Shopify’s discount code article. If you’re looking for a easy to use tool for create your Shopify discount codes, we recommend the Bulk Discounts Shopify app.

Did this answer your question?