campaignEmailDomainPerformance(string apikey, string cid)
Get the top 5 performing email domains for this campaign. Users want more than 5 should use campaign campaignEmailStatsAIM() or campaignEmailStatsAIMAll() and generate any additional stats they require.
| Section | Campaign Stats |
|---|
| Parameters | mcapi_campaignEmailDomainPerformance.php|
|---|---|
| apikey | a valid API Key for your user account. Get by visiting your API dashboard |
| cid | the campaign id to pull email domain performance for (can be gathered using campaigns()) |
| Returns | |
|---|---|
| array | domains email domains and their associated stats |
| Returned Fields | string | domain | Domain name or special "Other" to roll-up stats past 5 domains | integer | total_sent | Total Email across all domains - this will be the same in every row | integer | emails | Number of emails sent to this domain | integer | bounces | Number of bounces | integer | opens | Number of opens | integer | clicks | Number of clicks | integer | unsubs | Number of unsubs | integer | delivered | Number of deliveries | integer | emails_pct | Percentage of emails that went to this domain (whole number) | integer | bounces_pct | Percentage of bounces from this domain (whole number) | integer | opens_pct | Percentage of opens from this domain (whole number) | integer | clicks_pct | Percentage of clicks from this domain (whole number) | integer | unsubs_pct | Percentage of unsubs from this domain (whole number) |
|---|
[1] mcapi_campaignEmailDomainPerformance.php
<?php /** This Example shows how to retrieve email domain performance for a campaign via the API and do some basic error checking. **/ // Include the MailChimp API code. Do Not Edit This! require_once 'inc/MCAPI.class.php'; require_once 'inc/config.inc.php'; //contains apikey $domains = $api->campaignEmailDomainPerformance($campaignId); if ($api->errorCode){ } else { } else { foreach($domains as $domain){ } } } ?>