Foren

Google AdSense Portlet and Positioning...

thumbnail
David H Nebinger, geändert vor 12 Jahren.

Google AdSense Portlet and Positioning...

Liferay Legend Beiträge: 14914 Beitrittsdatum: 02.09.06 Neueste Beiträge
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, geändert vor 12 Jahren.

RE: Google AdSense Portlet and Positioning...

Junior Member Beiträge: 75 Beitrittsdatum: 12.09.07 Neueste Beiträge
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, geändert vor 12 Jahren.

RE: Google AdSense Portlet and Positioning...

Liferay Legend Beiträge: 14914 Beitrittsdatum: 02.09.06 Neueste Beiträge
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, geändert vor 12 Jahren.

RE: Google AdSense Portlet and Positioning...

Regular Member Beiträge: 102 Beitrittsdatum: 28.07.10 Neueste Beiträge
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, geändert vor 12 Jahren.

RE: Google AdSense Portlet and Positioning...

New Member Beiträge: 11 Beitrittsdatum: 27.08.11 Neueste Beiträge
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, geändert vor 12 Jahren.

RE: Google AdSense Portlet and Positioning...

New Member Beiträge: 4 Beitrittsdatum: 12.12.11 Neueste Beiträge
Could you please tell us how did you solve it? I have the same problem.

Regards
thumbnail
Aaron Paxson, geändert vor 12 Jahren.

RE: Google AdSense Portlet and Positioning...

Regular Member Beiträge: 102 Beitrittsdatum: 28.07.10 Neueste Beiträge
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, geändert vor 12 Jahren.

RE: Google AdSense Portlet and Positioning...

New Member Beiträge: 4 Beitrittsdatum: 04.12.11 Neueste Beiträge
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, geändert vor 11 Jahren.

RE: Google AdSense Portlet and Positioning...

New Member Beiträge: 4 Beitrittsdatum: 12.12.11 Neueste Beiträge
Thanks a lot vivek. This is exactly what I was looking for emoticon