Back to Documentation Overview

campaignEmailDomainPerformance

public static 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:
apikey a valid API Key for your user account. Get by calling login()
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)

Examples (1)

download example code

[1] mcapi_campaignEmailDomainPerformance.php

  1. <?php
  2. /**
  3. This Example shows how to retrieve email domain performance for a campaign via
  4. the API and do some basic error checking.
  5. **/
  6. // Include the MailChimp API code. Do Not Edit This!
  7. require_once 'inc/MCAPI.class.php';
  8. require_once 'inc/config.inc.php'; //contains apikey
  9.  
  10. $api = new MCAPI($apikey);
  11.  
  12. $domains = $api->campaignEmailDomainPerformance($campaignId);
  13.  
  14. if ($api->errorCode){
  15. echo "\tCode=".$api->errorCode."\n";
  16. echo "\tMsg=".$api->errorMessage."\n";
  17. } else {
  18. if (sizeof($domains)==0){
  19. echo "No Email Domain stats yet!\n";
  20. } else {
  21. foreach($domains as $domain){
  22. echo $domain['domain']."\n";
  23. echo "\tEmails: ".$domain['emails']."\n";
  24. echo "\tOpens: ".$domain['opens']."\n";
  25. echo "\tClicks: ".$domain['clicks']."\n";
  26. }
  27. }
  28. }
  29.  
  30. ?>
  31.  
  32.  
Add New Note User Contributed Notes for campaignEmailDomainPerformance
No notes, yet... Will you be the first??