Total Visitors

Archives

How to put Google Adsense in GWT

You can put the java script-code from Adsense in the single HTML page that GWT starts with. This way the advertising will not be displayed in the same area as GTW but above/below the GWT code. For advertising that could be ok.

This example places a baner above the application:
www.javaoracleblog.com

 

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>www.javaoracleblog.comtitle>
<script type="text/javascript" language="javascript" src="com.javaoracleblog.aggregator.nocache.js"></script>
head>
<body>
<script type="text/javascript"..
ADsense code here
script>

<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0">iframe>
body>
html>
In order to indicate to Google WT that the site of Google adsense can be trusted you need to add a regex matching URL to the -whitelist command line argument.

Note that this will probably not solve the problems desribed in the above "Why I dumped GWT" article.