private function get_cron_target_blog_id( $except_blog_id = 0 ) {
            if ( ! is_multisite() ) {
                return 0;
            }

            if ( $this->_is_network_active &&
                 is_numeric( $this->_storage->network_install_blog_id ) &&
                 $except_blog_id != $this->_storage->network_install_blog_id &&
                 self::is_site_active( $this->_storage->network_install_blog_id )
            ) {
                // Try to run cron from the main network blog.
                $install = $this->get_install_by_blog_id( $this->_storage->network_install_blog_id );

                if ( is_object( $install ) &&
                     ( $this->is_premium() || $install->is_tracking_allowed() )
                ) {
                    return $this->_storage->network_install_blog_id;
                }
            }

            // Get first opted-in blog ID with active tracking.
            $installs = $this->get_blog_install_map();
            foreach ( $installs as $blog_id => $install ) {
                if ( $except_blog_id != $blog_id &&
                     self::is_site_active( $blog_id ) &&
                     ( $this->is_premium() || $install->is_tracking_allowed() )
                ) {
                    return $blog_id;
                }
            }

            return 0;
        }