When an easyPoints customer makes a referral, the data will be stored in the customer metafield.
By adding a definition to the metafield and segmenting the data, a list of customers who have made a referral (referrer) and the number of times referrals were made can be tracked for analysis.
Adding a definition to the metafield
In order to successfully add a definition to the metafield, more than one referral needs to be made in the store.
Access the "Custom data" in the Shopify admin settings and click "Customer". Once the Customer metafield definitions page appears, click the "View Unstructured metafields" button.
On the list, choose
loyalty.easypoints_referral_count
This is a metafield that is displayed whenever a referral has been made and shows the total number of referrals made in the past.
Choose a 'Name' of your preference and 'integer' for type and set the 'minimum value' to 1.
After that is done, click save.
Segment Creation
Next we will create a segment using the metafield we have created.
Open "Segments" under customers on the Shopify admin and click "Create segment" in the upper right corner.
For conditions on the segment, make sure that the metafield created earlier is set to "IS NOT NULL" and this will create a list of customers who have made a referral in the past. The number of referrals made can be viewed in the customer page or by exporting the information in "more actions"
If your store has been using the referral reward feature in the past, there will be a metafield named "loyalty.easypoints-referrer" which is similar to "loyalty.easypoints_referral_count". This metafield was used before the update and can only indicate whether a referral was made, not how many.
Currently, all referrals made will only be added to the "loyalty.easypoints_referral_count" metafield including the amount of referrals made.
