Filter Stats by Multiple Tags
At the stats API, it would be helpful to be able to filter statistics by multiple tags.
E.g. if I have tag1 and tag2 to be able to view analytics for the emails that have *both* tag1 and tag2
this is a pretty big issue for my team as well, its causing us to consider switching. the option of a combined tag makes sense but the arbitrary limit of 3 tags is terrible.
I like this idea very much and I think it would be easy to make also. You could use the logic from
the events filter field: https://documentation.mailgun.com/en/latest/api-events.html#filter-field
# Include the Autoloader (see "Libraries" for install instructions)
# Instantiate the client.
$mgClient = new Mailgun('YOUR_API_KEY');
$domain = 'YOUR_DOMAIN_NAME';
# Issue the call to the client.
$result = $mgClient->get("$domain/stats/total", array(
'event' => array('accepted', 'delivered', 'failed'),
'duration' => '1m',
'tags' => '(campagne) AND (mail1 OR mail2)'
would return stats for all mails with 'campagne' and ('mail1' or 'mail2') tag
This will give the developer more control over the stats.
Ho Kuen Leung (PikachuEXE) commented
We used to have at least 2 tags per message (when using Mandrill):
- Email "type"
- Email content language
Now we cannot filter stats by multiple tags (with AND logic)
So it's hard to compare stats between different languages for same email "type"
I know we can add another tag combining the two, but a single message can only have up to 3 tags
That makes no room for us to add more tags to a message.