---
updatedAt: 2025-06-09T23:15:50.000Z
agentTools:
  projectIndex: https://developers.viral-loops.com/llms.txt
---

# Stat Widget

The Stat Widget is a small modular widget that can be used multiple times on your website to display statistics and information about the identified participant

After completing the [Installation](https://developers.viral-loops.com/docs/overview-1) step, use the following snippet to display the Leaderboard Widget:

```html HTML
<stat-widget stat="rank"></stat-widget>
```

If you are installing multiple campaigns on the same page make sure you also add the Campaign ID on the widget:

```html
<stat-widget stat="rank" ucid='Your Campaign ID'></stat-widget>
```

You can choose the type of info you want to display on the widget by changing the required `stat` attribute. The widget currently supports participant statistics with more data coming soon including campaign data:

<br />

## Participant Rank/Position on the Waitlist/Leaderboard/Campaign

```html
<stat-widget stat="rank"></stat-widget>
```

This will display the participant's current position on your campaign

<Image align="center" src="https://files.readme.io/bac39a62389f429f4b9bd7ab3301e313d83de3514907cdff9939a298fd6bd699-rank.PNG" />

<br />

## Referral count

```html
<stat-widget stat="referrals"></stat-widget>
```

This will display the referral count for the currently identified participant. On conversion campaigns, only converted participants count towards increasing this number.

<Image align="center" src="https://files.readme.io/c7e9dc47d91843b14d2f8d387b10f6738e96c3fd780a26a10d3618378867fbd0-referrals.PNG" />

## Pending referrals (conversion only)

```html
<stat-widget stat="pendingReferrals"></stat-widget>
```

This will display the number of referrals that are pending for conversion. This number only makes sense in the context of a campaign where a referral is complete when invitees join and then take an action (e.g. complete a purchase, create an account, etc)

<Image align="center" src="https://files.readme.io/ab57bb8845d86213af822d4e6fabe34a2a68b8f297aed410a83152e104dce912-pending.PNG" />

## Templates supported

* The Universal Referral
* Refer a Friend