The ads will appear in only a few games at first as the firm assesses users’ reactions.