# Discourse Affiliate - Invite to community

**URL:** https://meta.discourse.org/t/discourse-affiliate-invite-to-community/337795
**Category:** Support
**Created:** [November 22, 2024, 6:11pm UTC](https://meta.discourse.org/t/discourse-affiliate-invite-to-community/337795 "2024-11-22T18:11:36Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Timelord](https://avatars.discourse-cdn.com/v4/letter/t/ba9def/32.png) [@Timelord](https://meta.discourse.org/u/Timelord)
#### Post date: [November 22, 2024, 6:11pm UTC](https://meta.discourse.org/t/discourse-affiliate-invite-to-community/337795/1 "2024-11-22T18:11:36Z")

</div>

Hey team.

I did use the search box, but I could not find specifically what I am looking for.

What I would like to do is implement an old school affiliate program for Discourse. Simple as each user can create an affiliate link (linking back to the community). Each time the link is used, and a person signs up, the ‘owner’ of the affiliate link gets some kind of credit. Initially, a straight up count would work.

Down the road, I would like to integrate with the gamification plugin, but that’s for another day.

---

<div class="post-metadata">

### Author: ![Timelord](https://avatars.discourse-cdn.com/v4/letter/t/ba9def/32.png) [@Timelord](https://meta.discourse.org/u/Timelord)
#### Post date: [November 22, 2024, 6:13pm UTC](https://meta.discourse.org/t/discourse-affiliate-invite-to-community/337795/2 "2024-11-22T18:13:40Z")

</div>

It looks like the invite functionality may work.

Now - question is, is there a way to report on number of folks who signed up with an invite link.

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [November 22, 2024, 6:37pm UTC](https://meta.discourse.org/t/discourse-affiliate-invite-to-community/337795/3 "2024-11-22T18:37:42Z")

</div>

You can use [data explorer](https://meta.discourse.org/t/32566?silent=true)

> [@Use data explorer to get a list of users who signed up via invitations](https://meta.discourse.org/t/use-data-explorer-to-get-a-list-of-users-who-signed-up-via-invitations/224871/8):
>
> I was able to update this [data explorer](https://meta.discourse.org/t/32566?silent=true) query to include the invite\_key used by the user to join the site. SELECT u1.username AS invitee, u2.username AS inviter, i.invite\_key, iu.redeemed\_at FROM invited\_users iu JOIN invites i ON iu.invite\_id = i.id JOIN users u1 ON iu.user\_id = u1.id JOIN users u2 ON i.invited\_by\_id = u2.id WHERE iu.redeemed\_at IS NOT NULL ORDER BY iu.redeemed\_at DESC

---

<div class="post-metadata">

### Author: ![Timelord](https://avatars.discourse-cdn.com/v4/letter/t/ba9def/32.png) [@Timelord](https://meta.discourse.org/u/Timelord)
#### Post date: [November 22, 2024, 6:49pm UTC](https://meta.discourse.org/t/discourse-affiliate-invite-to-community/337795/4 "2024-11-22T18:49:05Z")

</div>

This will do just nicely. I can run the report, and add the points manually into the gamification plugin.

Thanks.

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [November 22, 2024, 6:54pm UTC](https://meta.discourse.org/t/discourse-affiliate-invite-to-community/337795/5 "2024-11-22T18:54:21Z")

</div>

You can also look into the `?username` system in discourse, which keeps track of and awards badges to users automatically when their links are followed. The 🔗 button on the post menu adds this automatically as you grab the link.

See [https://meta.discourse.org/badges/21/nice-share](https://meta.discourse.org/badges/21/nice-share) for how this looks here on meta.
