Referrals
Referral Page
Learn how to build a referral page.
When combining memberr Store Credit with Referrals, users experience a direct & tangible benefit by recommending friends and acquaintances.
Creating a customers referral link
{{shop.domain}}/?memberr-ref={{customer.id}}Accessing the Referral Program Metaobject
To access the Referral Program metaobject in your liquid templates, use the following code:
{%- assign referral_program = shop.metaobjects.app--60169453569--referral_program.v2 -%}You can use the following liquid code to display a customers referral link:
{{shop.domain}}/?memberr-ref={{customer.id}}Available Fields
The Referral Program metaobject contains the following fields:
| Field Name | Type | Description |
|---|---|---|
is_active | Boolean | Controls whether the referral program is currently active |
referring_customer_gets_type | Text | Type of reward for referring customer ('PERCENTAGE' or 'FIXED') |
referring_customer_gets_value_percentage | Decimal | Percentage reward for referring customer |
referring_customer_gets_value_money | Money | Fixed amount reward for referring customer |
referring_customer_expiry_days | Integer | Days until referring customer's reward expires |
referring_customer_availability_delay_days | Integer | Days before referring customer's reward becomes available |
referred_customer_gets_type | Text | Type of reward for referred customer ('PERCENTAGE', 'FIXED' or 'FREE_SHIPPING') |
referred_customer_gets_value_percentage | Decimal | Percentage reward for referred customer |
referred_customer_gets_value_money | Money | Fixed amount reward for referred customer |
referred_customer_minimum_order_value | Money | Minimum order value required for referred customer |
referred_customer_must_be_new_customer | Boolean | Whether the referred customer must be new |
cookie_duration_in_days | Integer | Duration of the referral tracking cookie |
Example Usage
Here's a complete example of how to display the Referral Program settings in your Liquid template:
{%- comment -%} Referral Program {%- endcomment -%}
{%- assign referral_program = shop.metaobjects.app--60169453569--referral_program.v2 -%}
{% if referral_program %}
<h2>Referral Program</h2>
<table class="program-table">
<tr>
<th colspan="2">Program Status</th>
</tr>
<tr>
<td>Is Active</td>
<td>{{ referral_program.is_active }}</td>
</tr>
<tr>
<th colspan="2">Referring Customer Rewards</th>
</tr>
<tr>
<td>Reward Type</td>
<td>{{ referral_program.referring_customer_gets_type }}</td>
</tr>
{% if referral_program.referring_customer_gets_type == 'PERCENTAGE' %}
<td>Reward Amount</td>
<td>{{ referral_program.referring_customer_gets_value_percentage }}%</td>
{% elsif referral_program.referring_customer_gets_type == 'FIXED' %}
<td>Reward Amount</td>
<td>{{ referral_program.referring_customer_gets_value_money.value | money }}</td>
{% endif %}
<tr>
<td>Expiry Days</td>
<td>{{ referral_program.referring_customer_expiry_days }}</td>
</tr>
<tr>
<td>Availability Delay</td>
<td>{{ referral_program.referring_customer_availability_delay_days }}</td>
</tr>
<tr>
<th colspan="2">Referred Customer Rewards</th>
</tr>
<tr>
<td>Reward Type</td>
<td>{{ referral_program.referred_customer_gets_type }}</td>
</tr>
{% if referral_program.referred_customer_gets_type == 'PERCENTAGE' %}
<td>Reward Amount</td>
<td>{{ referral_program.referred_customer_gets_value_percentage }}%</td>
{% elsif referral_program.referred_customer_gets_type == 'FIXED' %}
<td>Reward Amount</td>
<td>{{ referral_program.referred_customer_gets_value_money.value | money }}</td>
{% endif %}
<tr>
<td>Minimum Order Value</td>
<td>{{ referral_program.referred_customer_minimum_order_value.value | money }}</td>
</tr>
<tr>
<td>Must Be New Customer</td>
<td>{{ referral_program.referred_customer_must_be_new_customer }}</td>
</tr>
<tr>
<th colspan="2">Program Settings</th>
</tr>
<tr>
<td>Cookie Duration</td>
<td>{{ referral_program.cookie_duration_in_days }} days</td>
</tr>
</table>
{% endif %}Accounts Page
For Shopify Customer Accounts memberr offers a simple drag-&-drop element that can be accessed through the Shopify theme editor.
