留言板

Google AdSense Portlet and Positioning...

thumbnail
David H Nebinger,修改在12 年前。

Google AdSense Portlet and Positioning...

Liferay Legend 帖子: 14916 加入日期: 06-9-2 最近的帖子
I've been playing with the Google AdSense portlet, latest version 6.0.6.1 under 6.0.6 CE.

Everything is working, with the only problem being the ad position on the page. Regardless where I place the portlet on the page, the ad is always displayed at the bottom of the page, well out of view and not likely to generate any revenue.

So I guess my question is how do I control the positioning of the ad on the page? Is it supposed to be relative to the AdSense portlet positioning? Even if I add some css styling to the class "google-adsense-portlet" to my theme, will it really effect the ad that is being added to the page via JavaScript?
thumbnail
Vipin Menon,修改在12 年前。

RE: Google AdSense Portlet and Positioning...

Junior Member 帖子: 75 加入日期: 07-9-12 最近的帖子
Hi,

You are right - This Issue is very much reproducible. I tried a simple Adsense Portlet (6.0.6) and can't get it right. The ad is always displayed at the bottom of the page..Are you able to resolve this?

Regards,
Vipin
thumbnail
David H Nebinger,修改在12 年前。

RE: Google AdSense Portlet and Positioning...

Liferay Legend 帖子: 14916 加入日期: 06-9-2 最近的帖子
No, I haven't really investigated this yet. I was hoping for some feedback from the community, figuring someone else must have run into this before. But so far, nothing...
thumbnail
Aaron Paxson,修改在12 年前。

RE: Google AdSense Portlet and Positioning...

Regular Member 帖子: 102 加入日期: 10-7-28 最近的帖子
I, too, have this problem. The adsense portlet is the first portlet at the top of my page at http://myteneo.net. I'm guessing no one has a fix?
nadia surin,修改在12 年前。

RE: Google AdSense Portlet and Positioning...

New Member 帖子: 11 加入日期: 11-8-27 最近的帖子
Aaron Paxson:
I, too, have this problem. The adsense portlet is the first portlet at the top of my page at http://myteneo.net. I'm guessing no one has a fix?



Hello

I looked at your site and it appears that you may have resolve the issue with the adsense positioning, can you please tell me how you did it?

Thanks
julio Marquez,修改在12 年前。

RE: Google AdSense Portlet and Positioning...

New Member 帖子: 4 加入日期: 11-12-12 最近的帖子
Could you please tell us how did you solve it? I have the same problem.

Regards
thumbnail
Aaron Paxson,修改在12 年前。

RE: Google AdSense Portlet and Positioning...

Regular Member 帖子: 102 加入日期: 10-7-28 最近的帖子
Sorry. I didn't get a notification that there were posts here. I basically created web content and pasted Adsense code in the "source".
Vivek S,修改在12 年前。

RE: Google AdSense Portlet and Positioning...

New Member 帖子: 4 加入日期: 11-12-4 最近的帖子
Got it working!
Below is the modified portlet view.jsp
Basically, I encapsulated the script in a div tag. Removed <liferay-util:html-bottom> tag and moved <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> to the end.


<%@ include file="/init.jsp" %>
<div>
<aui:script position="inline">
google_ad_client = "<%= adClient %>";
google_ad_channel = "<%= adChannel %>";
google_ad_type = "<%= adTypeValue %>";
google_ad_height = <%= adTypeHeight %>;
google_ad_width = <%= adTypeWidth %>;
google_ad_format = "<%= adTypeWidth %>x<%= adTypeHeight %>_as";

google_color_border = "<%= colorBorder %>";
google_color_bg = "<%= colorBg %>";
google_color_link = "<%= colorLink %>";
google_color_text = "<%= colorText %>";
google_color_url = "<%= colorUrl %>";
</aui:script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div>
julio Marquez,修改在11 年前。

RE: Google AdSense Portlet and Positioning...

New Member 帖子: 4 加入日期: 11-12-12 最近的帖子
Thanks a lot vivek. This is exactly what I was looking for emoticon