reportCompare
public static array reportCompare (string token, string emailIDs)
Get the summary of more than one email campaign.
| Parameters |
| string token | A valid token for your account. To generate a token, use the login method. |
| string emailIDs | The comma seperated email campaign IDs for which the summary statistics are to be fetched. To get the email campaign ID, use the reportGet method. |
| Returns |
| array | Returns an array with the results. |
| Return Structure |
| string id | The email campaign ID |
| string emailName | The name of the email campaign |
| string mailSent | The total number of emails sent |
| string opens | The total number of opens. To get the details, use the reportGetOpens method. |
| string clicks | The total number of clicks. To get the details, use the reportGetClicks method. |
| string bounces | The total number of bounces. To get the details, use the reportGetBounces method. |
| string unsubscribes | The total number of unsubscribes. To get the details, use the reportGetUnsubscribes method. |
| string forwards | The total number of forwards. To get the details, use the reportGetForwards method. |
| string abuseReports | The total number of complaints received |
| integer toListID | The target contact list ID |
| string toListName | The target contact list name |
| string scheduleDate | Date on which the campaign was sent. |
- <?php
- /**
- This Example shows how to authenticate a user using XML-RPC.
- Note that we are using the PEAR XML-RPC client and recommend others do as well.
- **/
- require_once 'XML/RPC2/Client.php';
- require_once 'inc/config.php';
- $client = XML_RPC2_Client::create($apiURL);
- $token = $client->login($apiLogin, $apiPassword);
-
- /**
- Fetch the latest campaign, so we can retrieve the email campaign ID.
- **/
- $campaignList = $client->reportGet($token, "", 1, 10, "", "");
- $campaignIDs = $campaignList[0]['id'].",".$campaignList[1]['id'].",".$campaignList[2]['id'];
-
- $summary = $client->reportCompare($token, $campaignIDs);
-
- foreach($summary as $recs){
- echo " Campaign: " . $recs['emailName'] . "(" . $recs['id'] . ") <br />";
- echo " To: " . $recs['toListName'] . "(" . $recs['toListID'] . ") <br />";
- echo " Date: " . $recs['scheduleDate'] . "<br />";
- echo " Total Sent: " . $recs['mailSent'] . "<br />";
- echo " Opens: " . $recs['opens'] . "<br />";
- echo " Bounces: " . $recs['bounces'] . "<br />";
- echo " Unsubscribes: " . $recs['unsubscribes'] . "<br />";
- echo " Clicks: " . $recs['clicks'] . "<br />";
- echo " Forwards: " . $recs['forwards'] . "<br />";
- echo " Abuse Complaint: " . $recs['abuseReports'] . "<br />";
- }
-
- ?>