reportGetClicks
public static array reportGetClicks(string token, string emailID)
Get the click URL stats for the given campaign.
| Parameters |
| string token | A valid token for your account. To generate a token, use the login method. |
| string emailID | The email campaign ID for which the click 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 |
| integer sequence | The sequence number of the record |
| string URL | The URL which was clicked |
| string clicks | The total number of clicks received by the URL |
| string percent | The percentage of the clicks received by the URL. |
- <?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, 1, "", "");
- $campaignID = $campaignList[0]['id'];
-
- $clickList = $client->reportGetClicks($token, $campaignID);
-
- foreach($clickList as $rec){
- echo $rec['sequence'] . "] URL: " . $rec['URL'];
- echo " Clicks: " . $rec['clicks'];
- echo " Percent: " . $rec['percent'] . "<br />";
- }
-
- ?>