There are two Adsense for Maps products provided by Google to monetize Google Maps API application:
- Advertising alongside local bussines search result using the GoogleBar that requires your Adsense account be enabled for Adsense for Search
- Advertising based on map viewport using the Maps Ad Unit that requires your AdSense account be enabled for Adsense for Content.
Advertising using the GoogleBar

var map; if (GBrowserIsCompatible()) { var mapOptions = { googleBarOptions : { style : 'new', adsOptions: { client: 'your-publisher-id', channel: 'your-ads-channel-id', adsafe: 'high', language: 'en' } } } map = new GMap2(document.getElementById('map'), mapOptions); map.setCenter(new GLatLng(27.6648274, -81.5157535), 12); map.setUIToDefault(); map.enableGoogleBar(); }
Line 06: adsense options:
Line 07: your adsense publisher ID
Line 08: your adsense for search channel (optional)
Line 09: ad safety level (optional)
Line 10: language in which to display results
Advertising using the Maps Ad Unit

var adsManagerOptions = { maxAdsOnMap : 2, style: 'your-ads-unit', channel: 'your-ads-channel-id' }; var publisherID = 'your-publisher-ID'; adsManager = new GAdsManager(map, publisherID, adsManagerOptions); adsManager.enable();
Line 01: specify ads options
Line 02: maximum number of ads
Line 03: your ads unit
Line 04: your ads channel id
Line 07: specify your publisher id
Line 09: construct the GAdsManager object
Line 10: enable ads







I am currently making a website. I am very new to all this! this actually makes no sense? what do I actually do with this code????
thanks
Hi Richard, just put this code into your google map api application code, if you are new to google map programming, please read manuals and tutorials here