function phpAds_DeleteTracker($trackerid)
{
    global $phpAds_config;
    // Delete Campaign
    $res = phpAds_dbQuery("DELETE FROM " . $phpAds_config['tbl_trackers'] . " WHERE trackerid=" . $trackerid) or phpAds_sqlDie();
    // Delete Campaign/Tracker links
    $res = phpAds_dbQuery("DELETE FROM " . $phpAds_config['tbl_campaigns_trackers'] . " WHERE trackerid=" . $trackerid) or phpAds_sqlDie();
    // Delete Conversions Logged to this Tracker
    $res = phpAds_dbQuery("DELETE FROM " . $phpAds_config['tbl_conversionlog'] . " WHERE trackerid=" . $trackerid) or phpAds_sqlDie();
    // Delete stats for each banner
    phpAds_deleteStatsByTrackerID($trackerid);
}
            // Delete Banner ACLs
            phpAds_dbQuery("DELETE FROM " . $phpAds_config['tbl_acls'] . " WHERE bannerid=" . $bannerid) or phpAds_sqlDie();
            // Delete stats for each banner
            phpAds_deleteStatsByBannerID($bannerid);
        }
        // Delete Banners
        phpAds_dbQuery("DELETE FROM " . $phpAds_config['tbl_banners'] . " WHERE campaignid=" . $campaignid) or phpAds_sqlDie();
    }
    // Loop through each tracker
    $res_tracker = phpAds_dbQuery("SELECT trackerid" . " FROM " . $phpAds_config['tbl_trackers'] . " WHERE clientid=" . $clientid) or phpAds_sqlDie();
    while ($row_tracker = phpAds_dbFetchArray($res_tracker)) {
        $trackerid = $row_tracker['trackerid'];
        // Delete Campaign/Tracker links
        $res = phpAds_dbQuery("DELETE FROM " . $phpAds_config['tbl_campaigns_trackers'] . " WHERE trackerid=" . $trackerid) or phpAds_sqlDie();
        // Delete stats for each tracker
        phpAds_deleteStatsByTrackerID($trackerid);
    }
    // Delete Clients
    $res = phpAds_dbQuery("DELETE FROM " . $phpAds_config['tbl_clients'] . " WHERE clientid=" . $clientid) or phpAds_sqlDie();
    // Delete Campaigns
    $res = phpAds_dbQuery("DELETE FROM " . $phpAds_config['tbl_campaigns'] . " WHERE clientid=" . $clientid) or phpAds_sqlDie();
    // Delete Trackers
    $res = phpAds_dbQuery("DELETE FROM " . $phpAds_config['tbl_trackers'] . " WHERE clientid=" . $clientid) or phpAds_sqlDie();
}
// Rebuild priorities
phpAds_PriorityCalculate();
// Rebuild cache
if (!defined('LIBVIEWCACHE_INCLUDED')) {
    include phpAds_path . '/libraries/deliverycache/cache-' . $phpAds_config['delivery_caching'] . '.inc.php';
}
phpAds_cacheDelete();