How Can I find who used a Referral code in Klaviyo and What they Bought?

  • 19 January 2022
  • 1 reply

Badge +2

Hi everyone,


Can you tell me ‘where do i find the person who send a referral code to his/her friend?’ How do i know who’s friend bought?


Best answer by Taylor Tarpley 20 January 2022, 17:44

View original

1 reply

Userlevel 7
Badge +60

Hi @marifat


Welcome to the Community, we are so glad you’re here! 

While Klaviyo doesn’t have a native way to track referrals, you can utilize one of our third party Partners to develop a Referral program, such as Referral Candy, Swell, Yotpo, Smile, etc. to track these referrals.

However, if you’d like to create custom tracking events in Klaviyo to report on who’s referred your brand to a friend or send a thank you note to the person who referred you, you can create and track Referred Friend and Referred by Friend events. Similar to when someone shares content with a friend, the first event should be sent with our Javascript Track API while the second event should be sent with our server-side track API for each referred friend. As part of a server-side Track request you can also send profile properties, which may be useful in this case if a person can use a referral code to gain some kind of perk with your brand.

When someone refers a friend(s), you could send something like this for the referrer:

<script type="text/javascript">
_learnq.push(["track", "Referred Friend", { "Recipients": ["",""], "Quantity": 2 }]); </script>

At the same time, you can also send something like the following payload for each referred person:

{ "token": "PUBLIC_API_KEY", "event": "Referred by Friend", "customer_properties": { "$email": "", "ReferrerName": "John Smith", "ReferrerEmail": "", "ReferrerCode": "123abc456def" }, "properties": { "$event_id": "ZW1haWwub24ubGlzdEBlbWFpbC5jb20=_1500922636", }, "time": 1500922636 }


The Referrer code can then be used in a followup email to the referred people to create a unique link with the code in it. For example, in an email flow triggered by this Referred by Friend event, you could include this type of link:

{{ event|lookup:'ReferrerName'}} thought you might like this,
<a href="{{ event|lookup:'ReferrerCode}}">click here</a>
to find out if you do!


As this requires custom coding, I would recommend reaching out to a developer oran Awesome Klaviyo partner   to build this out for you if you wish to create these events in Klaviyo rather than using a third-party referral program. 


To track who bought an item after they’ve been referred to, you could create a segment to dynamically pull these users using the logic Properties About Someone > Referred by Friend at lease once AND What Someone Has Done >  Placed order attributed to X email". 


Thanks for being a part of our Community!