Get Stats for all campaigns from the API

kilroy123

New Member
It is possible to get stats across all campaigns via the API? I'm looking to build out a simple dashboard and get this information from MailWizz automatically via an API or some other mechanism.

- Average click rate
- Average open rate
- Unsubscribe rate over the last 30 days
- Number of new subscribers per day

I don't think it's possible from the API but maybe there is a way? Or maybe there's some other way to get this info?
 

kilroy123

New Member
@twisted1919 Actually, I think I found a bug. When I hit this stats API endpoint, it returns the same exact
'subscribers_count' number for *every single* campaign I fetch stats for. Which I know is not the same across all 30 of my last campaigns.

Digging through the code it looks like that number is pulled out from cache if it's the same. Is this a bug or am I confused what this number means? What I really need is the amount of subscribers that were on the list for that campaign.

PHP:
        $this->_subscribersCount = 0;

        $cacheKey = sha1(__METHOD__ . get_class($this->getOwner()) . $this->getOwner()->campaign_id);
        if (($this->_subscribersCount = $this->getFromCache($cacheKey)) === false) {
            $this->_subscribersCount = (int)$this->getOwner()->countSubscribers();
            $this->setInCache($cacheKey, $this->_subscribersCount, $this->getCacheDuration());
        }

        return (int)$this->_subscribersCount;
 
Top