How drupal.org found a website installed module I want to know how drupal.org counts the websites which use a specified module, as example in views module page reports:

Reported installs: 717,794 sites currently report using this module. View usage statistics.
Downloads: 4,815,869.

It is not hard to find the number of downloads but I want to know how drupal.org gets Reported installs?

Is there any way to find out the number of websites that use my custom modules that are not published in the drupal.org website?
Drupal.org gets 'reported installs' from the Update manager module. So to do something like that you would need you custom module to report back to a server of yours, and preferrably have your users be notified for that.