# Tracking referrals? Encouraging users to invite others?

**URL:** <https://meta.discourse.org/t/tracking-referrals-encouraging-users-to-invite-others/75040>\
**Category:** Community Building\
**Created:** [2017 年11 月 29 日 20:54 UTC](https://meta.discourse.org/t/tracking-referrals-encouraging-users-to-invite-others/75040 "2017-11-29T20:54:51Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

作者： ![SidV](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sidv/32/119460_2.png) [@SidV](https://meta.discourse.org/u/SidV)\
发布日期： [2017 年11 月 30 日 14:34 UTC](https://meta.discourse.org/t/tracking-referrals-encouraging-users-to-invite-others/75040/3 "2017-11-30T14:34:46Z")

</div>

As @fefrei said, you can use [Data Explorer](https://meta.discourse.org/t/32566?silent=true) with a query like this:

```sql
-- [params]
-- int :limit

select user_id, 
    invited_by_id
from invites
where created_at > CURRENT_TIMESTAMP - INTERVAL '30 days'
and user_id > 1
limit :limit

```

And modify that query with more complex query if you want.  
See this **[queries’s directory](https://github.com/SidVal/discourse-data-explorer/blob/queries/querys.md)** that you can use

Good luck !

Ps, updated: I added **[tracking-referrals.sql](https://github.com/SidVal/discourse-data-explorer/blob/queries/queries/tracking-referrals.sql)** to the list 😉

---

_[View the full topic](https://meta.discourse.org/t/tracking-referrals-encouraging-users-to-invite-others/75040)._
