Let's create a map with V2 of the Google Maps API. This is not the proper way to use the Google Maps layer, but I am including it because you are likely to come across a code that uses V2 of the API. Google Maps V2 also provides a few different layer types (like a moon layer) that V3 does not provide at the time of writing.
<head>section, before the OpenLayers script tag, include the following. Replace
YOUR_KEYwith the key generated from Step 1:
<script src='http://maps.google.com/maps?file=api&v=2&key=YOUR_KEY'></script> ...