The tech behemoth recorded expectation-busting ad revenues and reinforced its commitment to AI development.