Shares of the social media site surged more than 20% in early trading thanks to a big jump in ad revenue.