Fórumok

Google AdSense Portlet and Positioning...

thumbnail
David H Nebinger, módosítva 12 év-val korábban

Google AdSense Portlet and Positioning...

Liferay Legend Bejegyzések: 14916 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
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, módosítva 12 év-val korábban

RE: Google AdSense Portlet and Positioning...

Junior Member Bejegyzések: 75 Csatlakozás dátuma: 2007.09.12. Legújabb bejegyzések
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, módosítva 12 év-val korábban

RE: Google AdSense Portlet and Positioning...

Liferay Legend Bejegyzések: 14916 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
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, módosítva 12 év-val korábban

RE: Google AdSense Portlet and Positioning...

Regular Member Bejegyzések: 102 Csatlakozás dátuma: 2010.07.28. Legújabb bejegyzések
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, módosítva 12 év-val korábban

RE: Google AdSense Portlet and Positioning...

New Member Bejegyzések: 11 Csatlakozás dátuma: 2011.08.27. Legújabb bejegyzések
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, módosítva 12 év-val korábban

RE: Google AdSense Portlet and Positioning...

New Member Bejegyzések: 4 Csatlakozás dátuma: 2011.12.12. Legújabb bejegyzések
Could you please tell us how did you solve it? I have the same problem.

Regards
thumbnail
Aaron Paxson, módosítva 12 év-val korábban

RE: Google AdSense Portlet and Positioning...

Regular Member Bejegyzések: 102 Csatlakozás dátuma: 2010.07.28. Legújabb bejegyzések
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, módosítva 12 év-val korábban

RE: Google AdSense Portlet and Positioning...

New Member Bejegyzések: 4 Csatlakozás dátuma: 2011.12.04. Legújabb bejegyzések
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, módosítva 11 év-val korábban

RE: Google AdSense Portlet and Positioning...

New Member Bejegyzések: 4 Csatlakozás dátuma: 2011.12.12. Legújabb bejegyzések
Thanks a lot vivek. This is exactly what I was looking for emoticon