Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
David H Nebinger
Google AdSense Portlet and Positioning...
June 1, 2011 7:59 PM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11114

Join Date: September 1, 2006

Recent Posts

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?
Vipin Menon
RE: Google AdSense Portlet and Positioning...
June 10, 2011 8:43 PM
Answer

Vipin Menon

Rank: Junior Member

Posts: 75

Join Date: September 11, 2007

Recent Posts

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
David H Nebinger
RE: Google AdSense Portlet and Positioning...
June 13, 2011 9:10 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11114

Join Date: September 1, 2006

Recent Posts

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...
Aaron Paxson
RE: Google AdSense Portlet and Positioning...
August 29, 2011 5:31 PM
Answer

Aaron Paxson

Rank: Regular Member

Posts: 103

Join Date: July 27, 2010

Recent Posts

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
RE: Google AdSense Portlet and Positioning...
September 21, 2011 6:35 PM
Answer

nadia surin

Rank: New Member

Posts: 11

Join Date: August 26, 2011

Recent Posts

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
RE: Google AdSense Portlet and Positioning...
December 12, 2011 8:22 AM
Answer

julio Marquez

Rank: New Member

Posts: 3

Join Date: December 12, 2011

Recent Posts

Could you please tell us how did you solve it? I have the same problem.

Regards
Aaron Paxson
RE: Google AdSense Portlet and Positioning...
January 8, 2012 10:01 PM
Answer

Aaron Paxson

Rank: Regular Member

Posts: 103

Join Date: July 27, 2010

Recent Posts

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
RE: Google AdSense Portlet and Positioning...
February 21, 2012 7:24 PM
Answer

Vivek S

Rank: New Member

Posts: 4

Join Date: December 4, 2011

Recent Posts

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
RE: Google AdSense Portlet and Positioning...
May 15, 2012 4:58 AM
Answer

julio Marquez

Rank: New Member

Posts: 3

Join Date: December 12, 2011

Recent Posts

Thanks a lot vivek. This is exactly what I was looking for emoticon