# Issue getting Campaigne statistic thought api

**URL:** <https://forum.mautic.org/t/issue-getting-campaigne-statistic-thought-api/35716>\
**Category:** Development\
**Tags:** development\
**Created:** [May 23, 2025, 12:02pm UTC](https://forum.mautic.org/t/issue-getting-campaigne-statistic-thought-api/35716 "2025-05-23T12:02:03Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![kafoalex](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/kafoalex/32/12681_2.png) [@kafoalex](https://forum.mautic.org/u/kafoalex)\
**Post date:** [May 23, 2025, 12:02pm UTC](https://forum.mautic.org/t/issue-getting-campaigne-statistic-thought-api/35716/1 "2025-05-23T12:02:03Z")

</div>

![Campaigne](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/e/e3c994f6e0911bbec7a938550132add94691d93a.jpeg)  
**Hello Mautic Community,**

I hope you’re all doing well. I’m currently facing an issue retrieving campaign statistics via the API. I’ve tried using the endpoints `api/stats` and `api/campaigns`, but I haven’t been successful in accessing the specific statistics related to a campaign.

Has anyone encountered this issue before or found a reliable solution? I’d greatly appreciate any guidance or suggestions you could share.

Thank you in advance for your help and support

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [May 23, 2025, 12:15pm UTC](https://forum.mautic.org/t/issue-getting-campaigne-statistic-thought-api/35716/2 "2025-05-23T12:15:20Z")

</div>

Hello,

You can get the list of available stats tables here:

> **[Mautic Developer Documentation](https://developer.mautic.org/#get-available-stat-tables)**

And this is how you pull the data:

> **[Mautic Developer Documentation](https://developer.mautic.org/#get-stats-from-a-table)**

Regards:  
Joey

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [May 23, 2025, 12:23pm UTC](https://forum.mautic.org/t/issue-getting-campaigne-statistic-thought-api/35716/3 "2025-05-23T12:23:20Z")

</div>

Hi folks,

Just to add that the most up to date content is at

> **[Campaigns — Mautic Developer Documentation 3.0.0 documentation](https://devdocs.mautic.org/en/5.x/rest_api/campaigns.html)**

The old docs at [developer.mautic.org](http://developer.mautic.org) are there for legacy purposes, as we haven’t pulled all the content over yet, so there might be some content which is missing but the new devdocs site is the current one.

---

<div class="post-metadata">

**Author:** ![kafoalex](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/kafoalex/32/12681_2.png) [@kafoalex](https://forum.mautic.org/u/kafoalex)\
**Post date:** [May 23, 2025, 1:26pm UTC](https://forum.mautic.org/t/issue-getting-campaigne-statistic-thought-api/35716/4 "2025-05-23T13:26:58Z")

</div>

Thanks for your reply @joeyk I’m able to access some stats endpoint, but I’m still not getting the specific stats related to actions and decisions made within a particular campaign. I’ve gone through all the available stats tables, but none seem to show this information.

Below is the available table  
“availableTables”: [  
“asset\_downloads”,  
“audit\_log”,  
“campaign\_lead\_event\_log”,  
“campaign\_leads”,  
“channel\_url\_trackables”,  
“companies\_leads”,  
“dynamic\_content\_lead\_data”,  
“dynamic\_content\_stats”,  
“email\_stat\_replies”,  
“email\_stats”,  
“email\_stats\_devices”,  
“focus\_stats”,  
“form\_submissions”,  
“ip\_addresses”,  
“lead\_categories”,  
“lead\_companies\_change\_log”,  
“lead\_devices”,  
“lead\_donotcontact”,  
“lead\_event\_log”,  
“lead\_frequencyrules”,  
“lead\_lists\_leads”,  
“lead\_points\_change\_log”,  
“lead\_stages\_change\_log”,  
“lead\_utmtags”,  
“page\_hits”,  
“page\_redirects”,  
“point\_lead\_action\_log”,  
“point\_lead\_event\_log”,  
“push\_notification\_stats”,  
“sms\_message\_stats”,  
“stage\_lead\_action\_log”,  
“tweet\_stats”,  
“video\_hits”,  
“webhook\_logs”  
],

Any further insights would be greatly appreciated

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [May 23, 2025, 2:01pm UTC](https://forum.mautic.org/t/issue-getting-campaigne-statistic-thought-api/35716/5 "2025-05-23T14:01:01Z")

</div>

Hey,

Conditions and decisions are stored not as simly readable statistics, but as an entry as “Yes branch choosen” for example. Or event completed time / event scheduled time.  
You will need to build the stats from these building blocks.  
Just look at the campaign related tables to understand the logic.

Joey

---

<div class="post-metadata">

**Author:** ![kafoalex](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/kafoalex/32/12681_2.png) [@kafoalex](https://forum.mautic.org/u/kafoalex)\
**Post date:** [May 23, 2025, 2:51pm UTC](https://forum.mautic.org/t/issue-getting-campaigne-statistic-thought-api/35716/6 "2025-05-23T14:51:56Z")

</div>

Okay thanks @joeyk so you mean the “campaign\_leads” table right. What about this api /api/campaigns/events?

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [May 23, 2025, 3:21pm UTC](https://forum.mautic.org/t/issue-getting-campaigne-statistic-thought-api/35716/7 "2025-05-23T15:21:48Z")

</div>

I think that is just for listing the events.  
You would need to pull the data from the campaign\_lead\_event\_log.  
Each line is an event with scheduled date, completed date, yes/no path taken, etc.

---

<div class="post-metadata">

**Author:** ![kafoalex](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/kafoalex/32/12681_2.png) [@kafoalex](https://forum.mautic.org/u/kafoalex)\
**Post date:** [May 23, 2025, 3:46pm UTC](https://forum.mautic.org/t/issue-getting-campaigne-statistic-thought-api/35716/8 "2025-05-23T15:46:24Z")

</div>

> [@joeyk](#):
>
> campaign\_lead\_event\_log

I used the endpoint `api/stats/campaign_lead_event_log`, but the sample data I received doesn’t include any fields related to **email opens** or **clicks** , nor any values like `"yes"` in the JSON response.

```
{
        "id": "41230",
        "event_id": "128",
        "lead_id": "855",
        "campaign_id": "41",
        "rotation": "1",
        "date_triggered": "2024-05-27 13:58:03",
        "is_scheduled": "0",
        "system_triggered": "1",
        "metadata": "a:2:{s:6:\"failed\";i:1;s:6:\"reason\";s:37:\"165.154.164.142 has no email address.\";}",
        "channel": "email",
        "channel_id": "3",
        "non_action_path_taken": "0"
    },

```

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [May 23, 2025, 4:26pm UTC](https://forum.mautic.org/t/issue-getting-campaigne-statistic-thought-api/35716/9 "2025-05-23T16:26:33Z")

</div>

There is no ‘click’ and ‘open’ for campaigns.  
There is for Emails, you need to look in your email\_stats table.

How exactly your report should look like?

---

<div class="post-metadata">

**Author:** ![kafoalex](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/kafoalex/32/12681_2.png) [@kafoalex](https://forum.mautic.org/u/kafoalex)\
**Post date:** [May 26, 2025, 7:51am UTC](https://forum.mautic.org/t/issue-getting-campaigne-statistic-thought-api/35716/10 "2025-05-26T07:51:43Z")

</div>

Thanks once again for your reply. I will like to obtain specific statistics for the campaign—namely, the number of emails sent and the related interactions (opens, clicks, and page visits) like on the screenshort above for that particular campaign via an API. in resume decision, action and contact

 ![Campaigne](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/e/e3c994f6e0911bbec7a938550132add94691d93a.jpeg)

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [May 26, 2025, 9:24am UTC](https://forum.mautic.org/t/issue-getting-campaigne-statistic-thought-api/35716/11 "2025-05-26T09:24:22Z")

</div>

Hi,

you need to consrtuct this yourself by using the campaign\_lead\_event\_log (for decisions), email\_stats table (for email statistics), url\_redirects and page\_views (for clicks).

Check the tables above and you’ll see how it works.  
Joey

---

<div class="post-metadata">

**Author:** ![kafoalex](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/kafoalex/32/12681_2.png) [@kafoalex](https://forum.mautic.org/u/kafoalex)\
**Post date:** [May 26, 2025, 9:30am UTC](https://forum.mautic.org/t/issue-getting-campaigne-statistic-thought-api/35716/12 "2025-05-26T09:30:07Z")

</div>

Thanks i will try that

---

<div class="post-metadata">

**Author:** ![kafoalex](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/kafoalex/32/12681_2.png) [@kafoalex](https://forum.mautic.org/u/kafoalex)\
**Post date:** [May 26, 2025, 9:35am UTC](https://forum.mautic.org/t/issue-getting-campaigne-statistic-thought-api/35716/13 "2025-05-26T09:35:25Z")

</div>

Here is an example of campaign\_lead\_event\_log structure but i can see any decisions inside

```
        "id": "41739",
        "event_id": "527",
        "lead_id": "8354",
        "campaign_id": "58",
        "rotation": "1",
        "date_triggered": "2025-02-28 08:09:05",
        "is_scheduled": "0",
        "system_triggered": "1",
        "metadata": "a:2:{s:6:\"failed\";i:1;s:6:\"reason\";s:50:\"Head Of Marketing Department has no email address.\";}",
        "channel": "email",
        "channel_id": "65",
        "non_action_path_taken": "0"
    }

```

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [May 26, 2025, 10:46am UTC](https://forum.mautic.org/t/issue-getting-campaigne-statistic-thought-api/35716/14 "2025-05-26T10:46:17Z")

</div>

That is an email send action

---

<div class="post-metadata">

**Author:** ![kafoalex](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/kafoalex/32/12681_2.png) [@kafoalex](https://forum.mautic.org/u/kafoalex)\
**Post date:** [May 26, 2025, 10:49am UTC](https://forum.mautic.org/t/issue-getting-campaigne-statistic-thought-api/35716/15 "2025-05-26T10:49:20Z")

</div>

> [@kafoalex](#):
>
> “availableTables”: [  
> “asset\_downloads”,  
> “audit\_log”,  
> “campaign\_lead\_event\_log”,  
> “campaign\_leads”,  
> “channel\_url\_trackables”,  
> “companies\_leads”,  
> “dynamic\_content\_lead\_data”,  
> “dynamic\_content\_stats”,  
> “email\_stat\_replies”,  
> “email\_stats”,  
> “email\_stats\_devices”,  
> “focus\_stats”,  
> “form\_submissions”,  
> “ip\_addresses”,

On the email stats i have this structure below Please can i know the campaign which have sent this emails? What is the use of “source\_id”: “12” How is it linked? thanks for your reply

```
        "id": "33",
        "email_id": "9",
        "email_address": "pauleo@gmail.com",
        "date_sent": "2024-04-24 09:32:04",
        "is_read": "0",
        "is_failed": "0",
        "viewed_in_browser": "0",
        "tracking_hash": "6628d19445b9b600516137",
        "retry_count": "0",
        "source": "campaign.event",
        "source_id": "12",
        "open_count": "0",
        "open_details": "a:0:{}"
    },

```

---

<div class="post-metadata">

**Author:** ![kafoalex](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/kafoalex/32/12681_2.png) [@kafoalex](https://forum.mautic.org/u/kafoalex)\
**Post date:** [May 26, 2025, 11:03am UTC](https://forum.mautic.org/t/issue-getting-campaigne-statistic-thought-api/35716/16 "2025-05-26T11:03:35Z")

</div>

My issue is the process of linking theme in a unique way
