掲示板

Google AdSense Portlet and Positioning...

thumbnail
12年前 に David H Nebinger によって更新されました。

Google AdSense Portlet and Positioning...

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
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
12年前 に Vipin Menon によって更新されました。

RE: Google AdSense Portlet and Positioning...

Junior Member 投稿: 75 参加年月日: 07/09/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
12年前 に David H Nebinger によって更新されました。

RE: Google AdSense Portlet and Positioning...

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
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
12年前 に Aaron Paxson によって更新されました。

RE: Google AdSense Portlet and Positioning...

Regular Member 投稿: 102 参加年月日: 10/07/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?
12年前 に nadia surin によって更新されました。

RE: Google AdSense Portlet and Positioning...

New Member 投稿: 11 参加年月日: 11/08/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
12年前 に julio Marquez によって更新されました。

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
12年前 に Aaron Paxson によって更新されました。

RE: Google AdSense Portlet and Positioning...

Regular Member 投稿: 102 参加年月日: 10/07/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".
12年前 に Vivek S によって更新されました。

RE: Google AdSense Portlet and Positioning...

New Member 投稿: 4 参加年月日: 11/12/04 最新の投稿
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>
11年前 に julio Marquez によって更新されました。

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