# Statistieken filteren op land

**URL:** https://meta.discourse.org/t/filter-statistics-by-country/212427
**Category:** Support
**Created:** [17 december 2021 om 11:36 UTC](https://meta.discourse.org/t/filter-statistics-by-country/212427 "2021-12-17T11:36:34Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![warri0r](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/warri0r/32/243916_2.png) [@warri0r](https://meta.discourse.org/u/warri0r)
#### Post date: [17 december 2021 om 11:36 UTC](https://meta.discourse.org/t/filter-statistics-by-country/212427/1 "2021-12-17T11:36:34Z")

</div>

Is there a way to filter statistics by the country? Does anyone have a Plugin for this perhaps?  
I’m getting inquiries from all around the world and would like to know which country was the moste active every month.  
Thanks 😃

---

<div class="post-metadata">

### Author: ![RBoy](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@RBoy](https://meta.discourse.org/u/RBoy)
#### Post date: [6 november 2025 om 18:52 UTC](https://meta.discourse.org/t/filter-statistics-by-country/212427/2 "2025-11-06T18:52:06Z")

</div>

I don’t that exists as yet, traffic by country. It’s been requested a few times but the the answer appears to be use google analytics.

It would be awesome to that feature built directly in discourse through, one stop shop 🙂

---

<div class="post-metadata">

### Author: ![j127](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j127/32/79093_2.png) [@j127](https://meta.discourse.org/u/j127)
#### Post date: [6 november 2025 om 19:26 UTC](https://meta.discourse.org/t/filter-statistics-by-country/212427/3 "2025-11-06T19:26:41Z")

</div>

I wrote some code in my theme to send events into GA4 (and two other services) that can be filtered by country.

I can post the full file, if anyone wants to drop it in your theme, but it’s kind of messy. Here’s a sample:

```javascript
  api.onAppEvent("topic:created", (post, composerModel) => {
    if (post) {
      sendPHogEvent("topic_created", {});
      sendClickyEvent("#topic_created", "topic_created", "click");
      sendGA4Event({
        action: "topic_created",
      });
    }
  });

  api.onAppEvent("post:created", (post) => {
    if (post) {
      sendPHogEvent("post_created", {});
      sendClickyEvent("#post_created", "post_created", "click");
      sendGA4Event({
        action: "post_created",
      });
    }
  });

```

---

<div class="post-metadata">

### Author: ![ToddZ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/toddz/32/328350_2.png) [@ToddZ](https://meta.discourse.org/u/ToddZ)
#### Post date: [6 november 2025 om 19:33 UTC](https://meta.discourse.org/t/filter-statistics-by-country/212427/4 "2025-11-06T19:33:13Z")

</div>

Since I don’t want Google tracking and GDPR questions, I’m currently using [https://openpanel.dev/](https://openpanel.dev/) – it’s pretty nice. Open source & self-hostable, or hosted starting at $2.50/mo.

 ![image](https://global.discourse-cdn.com/meta/original/4X/8/4/8/848f3ae07d6f1de6e17d713b33bb254777b871e2.png)  
 ![image](https://global.discourse-cdn.com/meta/original/4X/9/d/e/9de572b3dd08c7bb9d13e04f216e32a7529ba483.png)

---

<div class="post-metadata">

### Author: ![RBoy](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@RBoy](https://meta.discourse.org/u/RBoy)
#### Post date: [5 december 2025 om 13:22 UTC](https://meta.discourse.org/t/filter-statistics-by-country/212427/5 "2025-12-05T13:22:16Z")

</div>

Interesting. I thought that by adding the GA ID in the discourse settings it would automatically send everything required for GA do all the analytics. Isn’t that the purpose of GA analytics or am I missing something here?

---

<div class="post-metadata">

### Author: ![j127](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j127/32/79093_2.png) [@j127](https://meta.discourse.org/u/j127)
#### Post date: [6 december 2025 om 21:18 UTC](https://meta.discourse.org/t/filter-statistics-by-country/212427/6 "2025-12-06T21:18:10Z")

</div>

I’m not sure. I just checked and I think I’m manually loading GA. Maybe that feature didn’t exist when I built the site and I missed it?

In any case, I’m sending events into three kinds of analytics.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [5 januari 2026 om 21:19 UTC](https://meta.discourse.org/t/filter-statistics-by-country/212427/7 "2026-01-05T21:19:10Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
