An increase in targeted ads is helping to fuel revenue growth and easing some concern about the technology’s impact.