Email analytics reveal whether your campaigns reach inboxes, get opened, and drive conversions. Mailgun provides robust tracking for delivery, engagement, and suppression events — but its native reporting has limits.
Marketing data analysts need to combine Mailgun metrics with CRM data, ad spend, and revenue to understand true email ROI. Mailgun's API delivers granular event data, yet building dashboards that tie email performance to business outcomes requires extraction pipelines, storage, and cross-platform joins.
This guide walks you through every step of Mailgun analytics: what metrics matter, how to pull data via API, where delivery rates break down, and how to build unified dashboards that connect email performance to campaign attribution and customer lifetime value.
Key Takeaways
✓ Mailgun tracks delivery, opens, clicks, bounces, complaints, and unsubscribes across every email campaign you send.
✓ Native Mailgun dashboards show real-time event data but lack cross-channel context — you can't see email ROI next to paid ads or CRM conversions.
✓ The Mailgun Events API delivers granular logs (JSON format) for every email interaction, enabling custom analytics and long-term storage.
✓ Mailgun reports that customers using its Deliverability Service see an average 97.4% delivery rate, compared to the industry average of 85%.
✓ Combining Mailgun data with Google Ads, Salesforce, and web analytics reveals which email campaigns drive pipeline and revenue — not just opens.
✓ Marketing data platforms automate Mailgun extraction, normalization, and integration with BI tools — eliminating manual API work and maintaining historical data when schemas change.
What Is Mailgun Analytics?
Mailgun analytics refers to the tracking, reporting, and measurement of email performance using Mailgun's platform. Mailgun logs every event tied to your emails: delivered, opened, clicked, bounced, marked as spam, or unsubscribed. Each event includes metadata — recipient email, timestamp, IP address, device type, and campaign tag.
Mailgun's Control Panel displays aggregate metrics (total sent, delivery rate, open rate) and event logs for troubleshooting. The Events API provides programmatic access to the same data, returning JSON objects you can store, analyze, or forward to data warehouses.
For marketing data analysts, Mailgun analytics answers operational questions (did the email deliver?) and strategic questions (which email segments generate the most revenue?). The challenge is connecting Mailgun's event stream to attribution models, CRM pipelines, and multi-touch campaign reporting.
Step 1: Understand Core Mailgun Metrics
Mailgun tracks six primary event types. Each maps to a stage in the email lifecycle.
Delivery Metrics
• Sent: Total emails accepted by Mailgun for delivery.
• Delivered: Emails successfully accepted by the recipient's mail server.
• Delivery Rate: (Delivered ÷ Sent) × 100. Mailgun's Deliverability Service achieves 97.4% on average.
Engagement Metrics
• Opens: Recipient loaded the email (tracked via invisible pixel). Undercounts due to image blocking and Apple Mail Privacy Protection.
• Clicks: Recipient clicked a tracked link. More reliable than opens for engagement measurement.
• Click-to-Open Rate (CTOR): (Clicks ÷ Opens) × 100. Measures content relevance among engaged recipients.
Negative Signals
• Bounces: Email rejected by recipient server. Hard bounces (invalid address) are permanent; soft bounces (full inbox) are temporary.
• Complaints: Recipient marked email as spam. High complaint rates damage sender reputation.
• Unsubscribes: Recipient opted out via unsubscribe link.
| Metric | Calculation | What It Tells You |
|---|---|---|
| Delivery Rate | (Delivered ÷ Sent) × 100 | List hygiene and domain reputation |
| Open Rate | (Opens ÷ Delivered) × 100 | Subject line effectiveness (with caveats) |
| Click Rate | (Clicks ÷ Delivered) × 100 | Content relevance and CTA strength |
| Bounce Rate | (Bounces ÷ Sent) × 100 | List quality — high rates trigger ISP blocks |
| Complaint Rate | (Complaints ÷ Delivered) × 100 | Audience mismatch or send frequency issues |
Marketing data analysts use these metrics to segment campaigns, identify deliverability issues, and prioritize engagement improvements. However, Mailgun metrics alone don't reveal downstream outcomes — revenue, pipeline, or customer retention.
Step 2: Access Mailgun Data via API
Mailgun's Events API delivers event-level data in JSON format. Each API call returns a batch of events (up to 300 per request) with pagination tokens for retrieving additional records.
API Authentication
Mailgun uses HTTP Basic Auth. Your API key (found in the Control Panel under Settings → API Keys) acts as the username. The password field remains empty.
Events Endpoint
The primary endpoint for analytics is:
GET https://api.mailgun.net/v3/{domain}/events
Replace {domain} with your sending domain (e.g., mg.example.com). Query parameters filter by event type, recipient, date range, or campaign tag.
Example API Request
Retrieve all "delivered" events from the past 24 hours:
curl -G https://api.mailgun.net/v3/mg.example.com/events \
-u 'api:YOUR_API_KEY' \
-d event='delivered' \
-d begin='Fri, 3 Jan 2026 00:00:00 GMT' \
-d ascending='yes' \
-d limit=300
Response Structure
The API returns a JSON object with an items array (each item is one event) and a paging object (URLs for next/previous pages).
Key fields per event:
• event: Type (delivered, opened, clicked, bounced, etc.)
• timestamp: Unix epoch time
• recipient: Email address
• message.headers.message-id: Unique message identifier
• tags: Campaign or segmentation tags
• user-variables: Custom metadata you attached at send time
Step 3: Track Email Deliverability
Deliverability measures whether emails reach the inbox (not spam folder or bounce). Mailgun provides domain-level deliverability stats, but analysts need to drill into failure reasons.
Bounce Classification
Mailgun categorizes bounces as:
• Hard Bounce: Permanent failure (invalid address, domain doesn't exist). Mailgun auto-suppresses hard-bounced addresses.
• Soft Bounce: Temporary failure (mailbox full, server timeout). Mailgun retries soft bounces for 72 hours.
The failed event includes a severity field ("permanent" or "temporary") and a reason field with the SMTP error code.
Suppression Lists
Mailgun maintains three suppression lists per domain:
• Bounces: Addresses that hard-bounced
• Unsubscribes: Recipients who opted out
• Complaints: Recipients who marked email as spam
Mailgun automatically prevents sends to suppressed addresses. Analysts should export suppression lists weekly to audit list hygiene and identify patterns (e.g., high bounce rates from a specific data source).
Sender Reputation Monitoring
ISPs assign reputation scores to sending IPs and domains. Low reputation triggers spam filtering or blocks. Mailgun's Control Panel shows bounce and complaint rates per domain — keep bounce rates below 3% and complaint rates below 0.1%.
If deliverability drops suddenly, check:
• Recent list imports (poor quality addresses)
• Send frequency spikes (looks like spam)
• Content changes (spam trigger words, broken links)
• Domain authentication (SPF, DKIM, DMARC records)
Step 4: Analyze Engagement Patterns
Mailgun logs opens and clicks, but raw event counts don't reveal campaign performance trends. Analysts need to segment by time, recipient cohort, and content variation.
Time-Based Segmentation
Break engagement metrics into hourly or daily buckets. Most opens occur within 4 hours of send; clicks peak 1–2 hours after open. Plotting engagement curves helps optimize send times and identify fatigue in re-engagement campaigns.
Cohort Analysis
Group recipients by acquisition source, lifecycle stage, or previous engagement. Compare open rates and CTOR across cohorts to identify high-value segments. Tag Mailgun sends with user-variables like acquisition_channel or ltv_tier for easy filtering.
Device and Client Data
Mailgun's opened events include client-info (email client name, OS, device type). Analysts can identify mobile vs. desktop engagement rates and optimize email design accordingly.
Step 5: Integrate Mailgun with Your Data Warehouse
Mailgun's Control Panel stores events for 30 days. Long-term analytics require exporting data to a warehouse (Snowflake, BigQuery, Redshift) where you can join email metrics with CRM, revenue, and attribution data.
Extraction Pipeline
Build a scheduled job (daily or hourly) that:
1. Calls the Events API with pagination
2. Parses JSON responses and flattens nested fields
3. Loads records into a staging table
4. Deduplicates events (Mailgun can return the same event multiple times)
5. Appends new records to the production table
Schema Design
A typical Mailgun events table includes:
• event_id: Unique identifier (concatenate message-id + event + timestamp)
• event_type: delivered, opened, clicked, etc.
• timestamp: Event time (convert from Unix epoch to datetime)
• recipient_email: Recipient address
• message_id: Mailgun message ID
• campaign_tag: Campaign or segmentation tag
• user_variables: Custom metadata (store as JSON or flatten key columns)
Join Patterns
To calculate email-influenced revenue:
1. Join Mailgun events to your CRM on recipient_email to get customer IDs
2. Join to orders or pipeline tables on customer_id and filter for conversions within 7–30 days of the email click
3. Aggregate revenue and pipeline value by campaign tag
- →You export Mailgun CSVs weekly and spend hours joining them to CRM data in spreadsheets
- →Deliverability drops go unnoticed for days because no one checks the Control Panel daily
- →Campaign ROI calculations are guesswork — you can't tie email clicks to closed deals
- →Historical email data disappears after 30 days, making year-over-year comparisons impossible
- →Every analyst defines 'engagement rate' differently because there's no shared data model
Step 6: Build Cross-Channel Email Dashboards
Marketing data analysts need dashboards that show email performance alongside paid ads, organic search, and CRM activity. Siloed Mailgun reports don't reveal which channels work together to drive conversions.
Dashboard Components
A comprehensive email analytics dashboard includes:
• Campaign performance table: Sent, delivered, opened, clicked, conversion rate, revenue per email
• Deliverability trends: Bounce rate, complaint rate, suppression list growth over time
• Engagement funnel: Delivered → Opened → Clicked → Converted (visualized as funnel chart)
• Cohort comparison: Engagement metrics by acquisition source or lifecycle stage
• Attribution view: Email-assisted conversions vs. email-attributed conversions (multi-touch vs. last-touch)
BI Tool Integration
Once Mailgun data lives in your warehouse, connect BI tools (Looker, Tableau, Power BI) directly to the warehouse. This avoids brittle custom scripts and lets analysts build self-service reports.
Pre-built data models speed up dashboard creation. Define standard metrics (delivery rate, CTOR, revenue per email) as calculated fields so every analyst uses consistent definitions.
Step 7: Automate Anomaly Detection
Email performance degrades suddenly when deliverability drops, content triggers spam filters, or segmentation logic breaks. Manual monitoring misses early warning signs.
Alerting Rules
Set up automated alerts for:
• Delivery rate drops below 95% (indicates list quality or reputation issue)
• Bounce rate exceeds 5% (immediate action required to avoid ISP blocks)
• Complaint rate exceeds 0.1% (content or targeting problem)
• Click rate drops 30% week-over-week (engagement fatigue or broken links)
• Zero sends in 24 hours (pipeline failure)
Statistical Thresholds
Simple threshold alerts (e.g., bounce rate above 5%) generate false positives when normal variance triggers the rule. Use rolling averages and standard deviations to detect statistically significant changes.
For example: alert when today's bounce rate exceeds the 7-day rolling average by more than 2 standard deviations.
Common Mistakes to Avoid
Marketing data analysts building Mailgun analytics pipelines encounter recurring pitfalls.
Treating Opens as Ground Truth
Apple Mail Privacy Protection pre-loads email images on mail servers (not user devices), inflating open counts. Open rates no longer reliably measure engagement. Prioritize clicks and conversions instead.
Ignoring Suppression List Growth
Suppression lists grow over time as addresses bounce or unsubscribe. If your suppression list contains 20% of your total list, you're sending to low-quality addresses or over-mailing engaged users. Audit suppression reasons quarterly.
Skipping Event Deduplication
Mailgun's Events API can return duplicate records during pagination. Without deduplication logic, your warehouse overstates event counts. Use a composite key (message-id + event type + timestamp) to filter duplicates.
Forgetting Timezone Conversions
Mailgun timestamps use UTC. If your BI tool defaults to local time without explicit timezone handling, engagement trends appear shifted by hours. Always store timestamps with timezone metadata.
Not Tagging Campaigns
Mailgun's tagging system (via o:tag parameter at send time) is the only way to group emails by campaign in analytics. Without tags, you can't calculate campaign-level ROI. Enforce tagging standards in your sending infrastructure.
Tools That Help with Mailgun Analytics
Several platforms simplify Mailgun data extraction, warehousing, and cross-channel reporting. Each suits different team sizes and technical capabilities.
| Tool | Best For | Key Features | Limitations | Pricing |
|---|---|---|---|---|
| Improvado | Marketing teams needing unified cross-channel analytics | 1,000+ pre-built connectors (Mailgun, Google Ads, Salesforce, etc.); automated schema normalization; Marketing Cloud Data Model; no-code dashboards + SQL access; 2-year historical data preservation on schema changes | Not ideal for non-marketing data use cases (e.g., product analytics, customer support) | Custom pricing |
| Fivetran | Engineering teams managing multi-source data pipelines | Automated Mailgun connector; 5-minute sync intervals; dbt integration for transformations | Requires data engineering to build marketing-specific models; no pre-built marketing dashboards | Starts $1,200/year |
| Stitch | Small teams with basic Mailgun extraction needs | Simple setup; affordable entry pricing; writes to Snowflake, Redshift, BigQuery | Limited transformation logic; slow support for Mailgun schema changes | Starts $100/month |
| Custom scripts | Teams with engineering capacity and unique requirements | Full control over extraction logic; no per-row costs | Maintenance burden; breaks when Mailgun updates API; no built-in deduplication or error handling | Engineering time |
Improvado stands out for marketing-specific use cases. It connects Mailgun to 1,000+ other marketing sources (Meta, LinkedIn, HubSpot, Salesforce) and normalizes metrics across platforms — so "clicks" in Mailgun aligns with "clicks" in Google Ads without manual mapping. The Marketing Cloud Data Model provides pre-built schemas for campaign attribution, budget tracking, and ROI reporting. Implementation typically completes within a week, and the platform maintains historical data when Mailgun changes its API schema.
Conclusion
Mailgun analytics delivers the raw material for email performance measurement: delivery events, engagement signals, and suppression data. The platform's API provides programmatic access to every event, enabling long-term storage and cross-channel analysis.
Marketing data analysts transform Mailgun's event stream into business intelligence by integrating email data with CRM pipelines, revenue systems, and multi-touch attribution models. This requires extraction pipelines, warehouse schemas that support joins across platforms, and dashboards that reveal how email campaigns influence customer behavior.
Teams that automate Mailgun data integration save hours per week previously spent on manual exports and CSV wrangling. They detect deliverability issues before ISP blocks occur, optimize send times based on engagement curves, and measure true email ROI by connecting clicks to closed deals.
FAQ
How long does Mailgun store event data?
Mailgun retains event logs for 30 days in the Control Panel and via the Events API. After 30 days, events are deleted and cannot be retrieved. Marketing data analysts should export events daily or hourly to a data warehouse for long-term analysis, historical comparisons, and compliance requirements.
Are Mailgun open rates still accurate after Apple Mail Privacy Protection?
No. Apple Mail Privacy Protection (launched 2021) pre-loads email images on mail servers, generating false opens before recipients view emails. This inflates open rates for Apple Mail users (roughly 40% of consumer email volume). Click rates and conversion rates remain reliable engagement metrics. Analysts should treat opens as an upper-bound estimate rather than ground truth.
Why do I see duplicate events in the Mailgun API?
Mailgun's Events API uses cursor-based pagination. When new events arrive during a paginated request, the same event can appear on multiple pages. Always deduplicate events in your warehouse using a composite key: message-id + event type + timestamp. Without deduplication, your metrics overcount opens, clicks, and deliveries.
Can I add campaign tags to emails after they're sent?
No. Mailgun tags must be specified at send time via the o:tag parameter. You cannot retroactively tag emails via the API. Enforce tagging standards in your sending infrastructure (e.g., require a campaign tag before emails enter the send queue) to ensure all emails are trackable in analytics.
Does Mailgun track clicks automatically?
Yes, if click tracking is enabled. Mailgun rewrites URLs in your email HTML to route through Mailgun's tracking domain (e.g., mailgun.clicks.example.com). When a recipient clicks, Mailgun logs the event and redirects to the original URL. Click tracking is enabled by default but can be disabled per message or per domain in Mailgun settings.
Can I get real-time Mailgun analytics?
Mailgun events appear in the API within seconds of occurrence. For real-time dashboards, set up a webhook that sends events to your warehouse as they happen (instead of polling the API every hour). Mailgun supports webhooks for all event types. Webhook payloads use the same JSON schema as the Events API.
How do I combine Mailgun data with Google Ads and Salesforce?
Load Mailgun events, Google Ads campaign data, and Salesforce leads into a shared data warehouse. Join tables on common keys: email address links Mailgun recipients to Salesforce contacts; UTM parameters link clicks to Google Ads campaigns. Pre-built marketing data platforms (like Improvado) automate these extractions and provide normalized schemas, eliminating manual join logic and reducing time-to-insight from weeks to days.
.png)



.png)
