To use this plugin you have to do two things:
It seems that Google has a restriction of showing a maximum of 3 ads per page, so it is not advised to configure more than 3 ads for a single page because they will no be shown.
In the ''site.xml'' put a powered by as the follow, and then, the plugin will replace the values
<project> ... <poweredBy> ... <logo name="googleAds" img="googleAds" /> ... </poweredBy> ... </project>
In any APT file, put an image with the next link. Remember the empty lines before and after the image.
... [googleAds] googleAds ...
In the ''site.xml'' put the banner left or banner right as the follow, and then, the plugin will replace the values
<project> ... <bannerLeft> <alt>googleAds</alt> <src>googleAds</src> </bannerLeft> <bannerRight> <alt>googleAds</alt> <src>googleAds</src> </bannerRight> ... </project>
In any APT file, put a link.
... Text text text {{{googleAds}googleAds} text text text. ...
In the ''site.xml'' put a powered by as the following, and then, the plugin will replace the values
<project> ... <poweredBy> ... <logo name="facebookILike" img="facebookILike" /> ... </poweredBy> ... </project>
In the ''site.xml'' put a powered by as the following, and then, the plugin will replace the values.
<project> ... <poweredBy> ... <logo name="customPoweredBy" img="customPoweredBy" /> ... </poweredBy> ... </project>
<project> ... <reporting> <plugins> ... <plugin> <groupId>net.sf.mgaip</groupId> <artifactId>mgaip</artifactId> <version>${project.version}</version> </plugin> </plugins> </reporting> ... </project>
<project> ... <reporting> <plugins> ... <plugin> <groupId>net.sf.mgaip</groupId> <artifactId>mgaip</artifactId> <version>${project.version}</version> <configuration> <googleId>ca-pub-9663595078690574</googleId> <horizontalAdId>2519400815</horizontalAdId> <horizontalAdHeight>2519400815</horizontalAdHeight> <horizontalAdWitdth>2519400815</horizontalAdWitdth> <logoAdId>1552583586</logoAdId> <uniqueAdId>7922030706</uniqueAdId> <verticalAdId>9409358178</verticalAdId> <facebookLink>https%3A%2F%2Fwww.facebook.com%2Fpages%2FZemucan%2F138284808329</facebookLink> <customPoweredBy><![CDATA[ <p>Hello custom World!<br/> Second line</p> ]]></customPoweredBy> </configuration> </plugin> </plugins> </reporting> ... </project>
Where googleId is the user identifier; xxxAdId are the banner identifiers in Google Ad Sense, it means the slot code for the ad; the name means the position in the page; Height and Width are the dimensions of the real ad.
The facebookLink is the page to like the "I like" button. The ':' and '/' has to be replaced by %3A, %2F respectively.
Custom powered by contains the code to be replace as raw text in the html.
One very important thing to have configured in order to use the plugin is the GoogleAds account. You need to have a valid already active account. If you do not, it could take until three days to be activated. This is not automatically created once you have created a Google Account, this is a different service, but you use the same credentials. If you want to activate it, you have to visit this page https://www.google.com/adsense/ . Once the service has been activated, you can create banners for your sites. We recommend the next possible banners for the different Ads positions in the site.
There are several type of Google Ads: https://www.google.com/adsense/static/AdFormats.html , however, we recommend the next configuration:
To generate the site with the Google Ads in the pages:
mvn site
However, if you have troubles with the Ads inserting, you could induce the replacement as an independent Maven call at the end, just like that.
mvn site net.sf.mgaip:mgaip:insert
Or, if you want to include the site publishing, you could do this:
mvn site net.sf.mgaip:mgaip:insert site:deploy