# How to include more entries in the "Top Referrers" report

**URL:** https://meta.discourse.org/t/how-to-include-more-entries-in-the-top-referrers-report/135346
**Category:** Data & reporting
**Tags:** sql-query
**Created:** [December 7, 2019, 11:11am UTC](https://meta.discourse.org/t/how-to-include-more-entries-in-the-top-referrers-report/135346 "2019-12-07T11:11:50Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![meglio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meglio/32/71444_2.png) [@meglio](https://meta.discourse.org/u/meglio)
#### Post date: [December 7, 2019, 11:11am UTC](https://meta.discourse.org/t/how-to-include-more-entries-in-the-top-referrers-report/135346/1 "2019-12-07T11:11:50Z")

</div>

The Top Referrers report only shows top 10 users:  
`/admin/reports/top_referrers`

Can I customize the number of entries in the table in any way?

---

<div class="post-metadata">

### Author: ![maiki](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maiki/32/233950_2.png) [@maiki](https://meta.discourse.org/u/maiki)
#### Post date: [December 8, 2019, 8:56pm UTC](https://meta.discourse.org/t/how-to-include-more-entries-in-the-top-referrers-report/135346/2 "2019-12-08T20:56:41Z")

</div>

AshtonJ took the code from the dashboard, for easy modding as a [Data Explorer](https://meta.discourse.org/t/32566?silent=true) (very cool plugin you’ll probably like) query:

> [@Top 10 referrers over the last month](https://meta.discourse.org/t/top-10-referrers-over-the-last-month/275145):
>
> Another one I can’t take any credit for - ripped directly out of DC’s dashboard smiley Top 10 referrers over the last month SELECT COUNT(\*) AS count\_all, incoming\_domains.name AS incoming\_domains\_name FROM "incoming\_links" INNER JOIN "posts" ON "posts"."id" = "incoming\_links"."post\_id" AND ("posts"."deleted\_at" IS NULL) INNER JOIN "topics" ON "topics"."id" = "posts"."topic\_id" AND ("topics"."deleted\_at" IS NULL) INNER JOIN "incoming\_referers" ON "incoming\_referers"."id" = "incoming\_l…

---

<div class="post-metadata">

### Author: ![meglio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meglio/32/71444_2.png) [@meglio](https://meta.discourse.org/u/meglio)
#### Post date: [December 21, 2019, 5:36am UTC](https://meta.discourse.org/t/how-to-include-more-entries-in-the-top-referrers-report/135346/3 "2019-12-21T05:36:46Z")

</div>

Thanks, but this query " **Top 10 referrers over the last month**" does not produce what I asked about.

> [@maiki](#):
>
> very cool plugin you’ll probably like

Which one?

---

<div class="post-metadata">

### Author: ![maiki](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maiki/32/233950_2.png) [@maiki](https://meta.discourse.org/u/maiki)
#### Post date: [December 21, 2019, 7:55am UTC](https://meta.discourse.org/t/how-to-include-more-entries-in-the-top-referrers-report/135346/4 "2019-12-21T07:55:53Z")

</div>

The [Data Explorer](https://meta.discourse.org/t/32566?silent=true) plugin allows you to query the data kept in Discourse.

---

<div class="post-metadata">

### Author: ![anon48433008](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@anon48433008](https://meta.discourse.org/u/anon48433008)
#### Post date: [December 21, 2019, 3:01pm UTC](https://meta.discourse.org/t/how-to-include-more-entries-in-the-top-referrers-report/135346/5 "2019-12-21T15:01:15Z")

</div>

If you add that now its missing, can you please copy paste the query you have so others can create/import that function?

---

<div class="post-metadata">

### Author: ![meglio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meglio/32/71444_2.png) [@meglio](https://meta.discourse.org/u/meglio)
#### Post date: [December 22, 2019, 2:06am UTC](https://meta.discourse.org/t/how-to-include-more-entries-in-the-top-referrers-report/135346/6 "2019-12-22T02:06:29Z")

</div>

> [@maiki](#):
>
> The [Data Explorer](https://meta.discourse.org/t/32566?silent=true) plugin allows you to query the data kept in Discourse.

Yes that’s what I wanted to do in case no setting is available.

Does anyone have a SQL query for the subject?

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [December 22, 2019, 7:16pm UTC](https://meta.discourse.org/t/how-to-include-more-entries-in-the-top-referrers-report/135346/7 "2019-12-22T19:16:05Z")

</div>

Isn’t what you want simply what maiki linked to except with the “`LIMIT 10`” tweaked up to a sane higher limit?

---

<div class="post-metadata">

### Author: ![meglio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meglio/32/71444_2.png) [@meglio](https://meta.discourse.org/u/meglio)
#### Post date: [January 7, 2020, 10:09am UTC](https://meta.discourse.org/t/how-to-include-more-entries-in-the-top-referrers-report/135346/8 "2020-01-07T10:09:13Z")

</div>

> [@Mittineague](#):
>
> Isn’t what you want simply what maiki linked to except with the “ `LIMIT 10` ” tweaked up to a sane higher limit?

Nope. What I need is the data shown by this link `/admin/reports/top_referrers`.

> Users listed by number of clicks on links they have shared.
