smsCampaignStats()

SMS campaign reports or major statistical data of SMS campaign are obtained. In order to obtain more detailed data, additional functions have to be used.

smsCampaignStats(string $cid) : array
Input parameters
  • cid - SMS campaign ID
Information obtained

SMS campaign statistics is represented as an array that includes:

  • delivered - number of delivered SMS
  • sent - number of sent SMS. Information about success or failure is not yet received.
  • queued - number of SMS that are queued and still waiting to be sent
  • temporary_bounces - temporary bounces
  • undelivered - number of undelivered SMS
  • error - number of undelivered SMS that were having some technical issues during the process of delivery
  • other - number of SMS having other status of delivery
  • clicks - number of clicks on links
  • unique_clicks - number of unique clicks on links
  • last_click - date of the last click
  • users_who_clicked - subscribers that have clicked
  • sms_sent - total number of sent SMS

Examples

mgapi_smsCampaignStats.php
smsCampaignStats($cid);
 
header("Content-Type: text/plain");
if ($api->errorCode){
    echo "Unable to load smsCampaignStats()!";
    echo "\tCode=".$api->errorCode."\n";
    echo "\tMsg=".$api->errorMessage."\n";
} else {
    echo "Stats for ".$cid."\n";
    foreach($retval as $k=>$v){
        echo "\t".$k." => ".$v."\n";
    }
}

© 2010-2017 Mailigen. All rights reserved.