Back to Documentation Overview
campaignClickStats
public static campaignClickStats(string apikey, string cid)
Get an array of the urls being tracked, and their click counts for a given campaign
- Section:
- Campaign Stats
- Parameters:
apikey a valid API Key for your user account. Get by calling login() cid the campaign id to pull stats for (can be gathered using campaigns()) - Returns:
- struct - urls will be keys and contain their associated statistics:
- Returned Fields:
integer clicks Number of times the specific link was clicked integer unique Number of unique people who clicked on the specific link - <?php
- /**
- This Example shows how to pull and iterate through a campaignClickStats call via
- using the MCAPI wrapper class.
- **/
- require_once 'inc/MCAPI.class.php';
- require_once 'inc/config.inc.php'; //contains apikey
- $stats = $api->campaignClickStats($campaignId);
- if ($api->errorCode){
- } else {
- } else {
- foreach($stats as $url=>$detail){
- }
- }
- }
- ?>
- <?php
- /**
- This Example shows how to iterate through a campaignClickStats call 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.inc.php';
- try {
- $result = $client->campaignClickStats($apikey, $campaignId);
- foreach($result as $url=>$stats){
- }
- } catch (XML_RPC2_FaultException $e){
- }
Examples (2)
download example code[1] mcapi_campaignClickStats.php
[2] xml-rpc_campaignClickStats.php
|
Add New Note
User Contributed Notes for
campaignClickStats |
|---|
| No notes, yet... Will you be the first?? |