Tracking referrals? Encouraging users to invite others?

I’m looking for ways to grow my site. We are close to 1000 members but we just hit a slump in growth.

We plan on doing a contest of some type but we want to make sure the contest encourages further growth. We thought about doing a contest: Whoever invites the most active users in 30 days wins.

This could be effective but the problem is I don’t see any admin overview of signups via invite or sitewide user activity, so it would be difficult to track.

Does anyone know of a way we can track invites and user activity sitewide?


This is something for the Data Explorer plugin, it allows you to run custom SQL queries against the Discourse database.

If you’re somewhat versed in SQL, using Data Explorer is pretty easy since it has included help to show you the database scheme; otherwise, I’m sure you’ll get some help here if you describe what you want, exactly :slight_smile:

1 Like

As @fefrei said, you can use Data Explorer with a query like this:

-- [params]
-- int :limit

select user_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 that you can use

Good luck !

Ps, updated: I added tracking-referrals.sql to the list :wink:


Thanks for the help!

1 Like

I tried running this and got a syntax error “at or around line 25”

Henry, on that link there are two queries. Which version are you trying ?
I tested the both now, and works fine. :thinking:


Oops. Didn’t notice there was two. I ended up copy pasting both thinking it was one.

Problem solved :slight_smile: