Search code examples
google-mapsgoogle-maps-api-3adsadsense

How can I show ads (adsense or local search ads) in my custom map created with the Maps API?


Is there any way to show adsense ads on a custom map created with the Google Maps API?

Google recently rolled out "local search ads" which show local ads on Google maps. However, the same ads are not visible on a map which was created with the Maps API.


Solution

  • The AdSense library of Google Maps JavaScript API was deprecated in May 2015. If you check the release notes for version 3.22 of JavaScript API, you will see the following text

    5 November 2015

    The AdSense library has been deprecated since May 2015, and is no longer available in the experimental version of the Google Maps JavaScript API. The library will be removed from the release and frozen versions of the API soon. An alternative solution is Google AdSense. See the guide to creating an AdSense ad unit.

    source: https://developers.google.com/maps/documentation/javascript/releases#322

    Try to use Google AdSense ad unit as suggested in this document.