getEligiblePage = async (pageGroup, req, res) => {
  if (pageGroup.members.length === 0)
    return req.__("Pagegroup %s has no members", pageGroup.name);
  else {
    let screenInfos = null;
    if (req.cookies["_sc_screen_info_"]) {
      screenInfos = JSON.parse(req.cookies["_sc_screen_info_"]);
      screenInfos.device = uaDevice(req);
    } else {
      const strategy = getState().getConfig(
        "missing_screen_info_strategy",
        "guess_from_user_agent"
      );
      if (strategy === "guess_from_user_agent")
        screenInfos = screenInfoFromCfg(req);
      else if (strategy === "reload" && req.query.is_reload !== "true") {
        res.sendWrap(
          script(
            domReady(`
            setScreenInfoCookie();
            window.location = updateQueryStringParameter(window.location.href, "is_reload", true);`)
          )
        );
        return { isReload: true };
      }
    }
    return await pageGroup.getEligiblePage(
      screenInfos,
      req.user ? req.user : { role_id: features.public_user_role },
      req.getLocale()
    );
  }
}
get the eligible page for pagegroup with respect to the screen infos
@param {PageGroup} pageGroup
@param {any} req
@param {any} res
@returns eligible page an error message or an object with reload flag