# How Discord invite tracking works

> How Discord invite tracking works: a bot compares invite use counts before and after a member joins to see which link they used, and credits the inviter.

URL: https://www.jalkarna.in/based/learn/how-discord-invite-tracking-works/  
Last updated: 2026-11-16

Discord invite tracking works by comparing each invite link's use count before and after someone joins. The invite whose count went up is the one the new member used, so the bot can credit the person who created it. Discord doesn't announce this directly, so tracking relies on a bot that can read the server's invites.

## How does a bot know which invite was used?

Every Discord invite has a use counter. A tracking bot works like this:

1. It stores a snapshot of all invites and their use counts.
2. A new member joins.
3. The bot fetches the invite list again and compares it with the snapshot.
4. The invite whose count increased is recorded as the one used.
5. The invite's creator gets credit for the join.

This is why the bot needs permission to see the server's invites. In Discord, that is the Manage Server permission. See [how Discord permissions work](https://www.jalkarna.in/based/learn/how-discord-permissions-work/).

## Why would you track invites?

- **Know what works.** Make a separate link for each source, such as a video, a partner server, or a social post, and compare results. This is central to [growing a Discord server](https://www.jalkarna.in/based/learn/how-to-grow-a-discord-server/).
- **Reward helpful members.** An invite leaderboard recognizes people who bring friends.
- **Run invite-based giveaways.** Requirements like "invite three people this week" need counts. See [giveaway entry requirements](https://www.jalkarna.in/based/learn/giveaway-entry-requirements-explained/).
- **Spot suspicious patterns.** A link that brings many accounts in minutes deserves a look.

## What are the limits of invite tracking?

Tracking is a best-effort comparison, not a perfect record. Be aware of these cases:

- **Simultaneous joins.** If two people join close together using different links, the bot can mis-attribute one.
- **Vanity and special links.** Servers with a custom invite URL, or members who arrive through other routes, may not be attributable to a single person.
- **Expired or maxed-out invites.** When an invite hits its use limit or expires, it disappears and the bot may need to infer what happened.
- **Missed history.** Tracking starts when it's enabled. Members who joined earlier aren't counted retroactively.
- **Missing permission.** Without Manage Server, the bot can't read invites at all.

Treat numbers as strong signals rather than courtroom evidence.

## What about privacy?

Invite tracking records who invited whom, which is a relationship between accounts. Good practice is to track only counts and the link used, avoid storing message content, tell your members it's happening, and choose who can view the numbers. Staff-only or personal visibility is a reasonable default.

## Common mistakes

- **One shared link everywhere.** You can't tell sources apart. Create separate links.
- **Never-expiring links shared publicly.** They can be posted on sites you don't control. Use expiry or use limits for sensitive links.
- **Rewarding raw invite counts.** This can encourage spam-inviting. Combine with a minimum membership requirement.
- **Forgetting to resync.** After many invites change, refresh the cache so counts stay accurate.

## Doing this with Based

Based's Activity tracking module is off by default. It counts messages (message text is never saved) and can optionally record which invite each new member used, which needs the Manage Server permission. Use `/invites` to see a member's tracked invites, `/topinvites` for the server's invite leaderboard, and `/syncinvites` (Manage Server) to refresh the tracked invite cache. A visibility setting controls whether members see only their own stats, staff only, or public leaderboards. Every slash command also works with the "." prefix, for example `.topinvites`.

Details are in the [activity tracking docs](https://www.jalkarna.in/based/docs/activity-tracking/).

## FAQ

### Can Discord show who invited someone?

Not directly for every join. Server owners can see invite usage in Discord, but per-person attribution generally needs a bot that compares invite counts when someone joins.

### What permission does an invite tracker need?

It needs Manage Server so it can read the server's invite list and use counts.

### Why is my invite count wrong?

Common causes are simultaneous joins, expired invites, vanity links, or tracking that wasn't on when members joined. Refreshing the invite cache can fix drift.

### Does invite tracking read my messages?

It doesn't need to. Invite tracking only compares link use counts, and message-activity counting can be done with counts alone.

## Related
- [How to grow a Discord server](https://www.jalkarna.in/based/learn/how-to-grow-a-discord-server/)
- [Giveaway entry requirements explained](https://www.jalkarna.in/based/learn/giveaway-entry-requirements-explained/)
- [Discord activity leaderboards explained](https://www.jalkarna.in/based/learn/discord-activity-leaderboards/)
- [How Discord permissions work](https://www.jalkarna.in/based/learn/how-discord-permissions-work/)
