All it takes to get started with YesGraph is to add a small code snippet to your site. Here we’ll describe where to find the code (spoiler: on your YesGraph integration dashboard), and how to customize it to track referrals.

Building a Referral Program

Want to see how we used our own tools to build our referral program? Check out this blog post!

Copy the Code

Your YesGraph dashboard will generate a custom code snippet for your app. To find it, sign in to YesGraph and navigate to the Integration tab. There you’ll find the code snippet to copy onto your website.

Start Tracking Referrals

Your code snippet can be customized for each user, to include for example a username or referral code. Spend 5 minutes customizing your code, and it will help you link each new signup to the user who invited them.

To include custom user data, just add data-* attributes to the <span> tag in your code snippet. For example, if you had a first name, a username, and a referral code, then your code snippet might look like this:

<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="https://cdn.yesgraph.com/yesgraph-invites.min.js"></script>
<span id="yesgraph" class="yesgraph-invites"
      data-app="abcde-12345-abcde-12345"
      data-first_name="Maria"
      data-username="marialopez05"
      data-referral_code="123ABC">
</span>

Now you can use this data in your invite link template:

www.example.com/signup?referral_code={{ referral_code }}

And the invite link for the example user “Maria” will include her personal referral code:
www.example.com/signup?referral_code=123ABC

When one of her contacts signs up at that link, you’ll know it was “Maria” who invited them.