You'll need to do it on the server side. The cleanest way is to check the visitor's IP and user-agent, but don’t just rely on user-agent strings, they're easy to fake. Better do a reverse DNS lookup to make sure it’s actually googlebot knocking at your door. If it checks out, serve up your content B, otherwise, just show regular users the normal version - content A. You can pull this off using PHP, python, or some server rules (like Apache or Nginx). Just tread it really carefully. As it has already said,google can catch on if there's a mismatch, and if they do, you're seriously risking.