improve checking of required data in snippet, make page id an optional parameter for the snippet