Java – how to put Google Adsense in GWT

Does anyone know how to put Google Adsense ads in GWT web applications?

Solution

You can put the JavaScript code in Adsense in a single HTML page at the beginning of GWT In this way, the advertisement will not be displayed in the same area as GTW, but above / below GWT code For possible advertising

This example places a blank on the application:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <Meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title>www.javaoracleblog.com</title>
    <script type="text/javascript" language="javascript" src="com.javaoracleblog.aggregator.nocache.js"></script>
  </head>
  <body>
<script type="text/javascript"..
ADsense code here 
</script>
    <!-- OPTIONAL: include this if you want history support -->
    <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
  </body>
</html>

To show Google wt that Google Adsense's website can be trusted, you need to add a regular expression matching URL to the - whitelist command line parameter

Please note that this may not solve the problem described in the "why I dump GWT" article above

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>