logo logo

How to Add Adsense into Your Google Map API Application

Home » Information Technology » How to Add Adsense into Your Google Map API Application




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

Adsense using the GoogleBar

Adsense 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

Adsense using Maps Ad Unit

Adsense using 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

Share
Related post:
  • No Related Post
bottom

15 Responses to “How to Add Adsense into Your Google Map API Application”

  1. Richard says:

    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

  2. Google Search for Mobile Phone Users Now Includes Mobile App Results…

    Great blog from BlogFlaw.com about Google search on mobile…

  3. GLEN says:

    PillSpot.org. Canadian Health&Care.No prescription online pharmacy.Special Internet Prices.PillSpot.org. Herbal-supplements@buy.online” rel=”nofollow”>.…

    Categories: Vitamins/Herbal Supplements.Eye Care.Stomach.Antibiotics.Stop SmokingAntidiabetic.Womens Health.Anti-allergic/Asthma.Anxiety/Sleep Aid.Skin Care.Weight Loss.Blood Pressure/Heart.Antiviral.Mental HealthAntidepressants.Pain Relief.Mens H…

  4. Purchase mp3 music online…

    Good luck everybody! – I will come back again. Are you on facebook or twitter? Will like to follow you.Thanks…

  5. Service says:

    Service http://6n5.1ix.201i.co : Truck…

    Bulletin…

  6. Great Photography Tutorials…

    Super stuff! This was a really effective publish….

  7. I much like it!…

    Amazing article. I need you up-to-date your weblog much more often, I just cannot appear to be to own adequate of one’s blog. I saved your weblog in my bookmarks. Would it be feasible to do a guest article sometime?…

  8. Rapid weight loss plan and diets…

    Around motivational publish you bear at this juncture. Seems to lots of persons enjoyed and benefited from it. Cheers and appreciation….

  9. Rapid weight loss plan and diets…

    Easy to understand,I like it!…

  10. Rapid weight loss plan and diets…

    Wow…. Amazing in a row.. Many credit…

  11. nitro rcx says:

    Buy Soft Toys & Childrens Toy online now!…

    This post is so help to me! Thanks for share….

  12. The Best Family Vacation Ideas – For Family Vocations…

    Fine to back your blog, I get back it again pro re a month, pronto I bear bookmarked it….

  13. Another Title…

    I saw this really great post today….

Leave a Reply

 
bottom