Hi guys,
I have been doing some maths in order to attempt to estimate our total influence. After all any action we take is likely to be supported by our subscribers too so I think it is only right we take notice of them as well. I do accept that this number is an estimate, there is a limitation on the accuracy due to the limited data available, and I tried to keep the maths simple for the sake of everyone being able to follow. This is my second draft but I feel it has been made accurate enough to publish now. Please feel free to note any innacuracies, (beyond the obvious that accuracy would be increased if we had more data). I am fairly confident that this method gives a reasonable estimate that is representative of our numbers. for anyone who cant open the PDF, our estimated subscriber influence is
108.9 million subscribers.
Methodology and potential issues with the calculation are noted in the attached PDF
If you can get members to submit their YouTube Channel ID's, as I presume you have in the works for the Virtual Membership system -
Simply build a comma separated array of Channel ID's - in this format - channelId,channelId,channelId,channelId
Then run it through this PHP script and it will tell you the exact amount of subscribers totalled from the provided Channel ID's without having to estimate!
*Note* You will need your own Data API Key, and to feed your created array in to the $userChannelsArray string, by default I've selected 3 Channel ID's to demonstrate it working.
Here's the API's Explorer for the functionality reference -
developers.google.com/apis-explorer/#p/youtube/v3/youtube.channels.list?part=snippet%252CcontentDetails%252Cstatistics&id=UCv9Edl_WbtbPeURPtFDo-uA%252CUCIveFvW-ARp_B_RckhweNJw%252CUCC3L8QaxqEGUiBC252GHy3w&_h=3&<?php
$api_key = "YOUR_YOUTUBE_API_KEY";
$userChannelsArray = "UCv9Edl_WbtbPeURPtFDo-uA,UCIveFvW-ARp_B_RckhweNJw,UCC3L8QaxqEGUiBC252GHy3w";
$tallySubscribers = 0;
$_SESSION['newChannel'] = array();
$url = "https://www.googleapis.com/youtube/v3/channels?part=snippet%2CcontentDetails%2Cstatistics&id=$userChannelsArray&key=$api_key";
$arr_list = channelsList($url);
foreach ($arr_list as $alist) {
foreach ($alist as $list) {
$newId = ($list->id);
$newStatSubscribers = ($list->statistics->subscriberCount);
$tallySubscribers = ($tallySubscribers + $newStatSubscribers);
}
}
function channelsList($api_url) {
$arr_result = json_decode(file_get_contents($api_url));
if (isset($arr_result->items) && !empty($arr_result->items)) {
$_SESSION['newChannel'][] = $arr_result->items;
}
return $_SESSION['newChannel'];
}
echo "The array of channels has a total of ".$tallySubscribers." subscribers!";
?>
This script could very easily be modified to also tally total videos / views if needed as well.
Let me know if you need any more information.