?
Solved

Google adsense loading multiple banners randomly

Posted on 2012-09-20
5
Medium Priority
?
453 Views
Last Modified: 2012-09-25
Is it possible to load Google Adsense code in a DIV using jQUERY.  The reason for this is random banners appear on a page.  Here is some sample Google banner code. I know you can have only 3 banners per page.  I just want to randomly place the divs on the pag

<!-- Start Here -->

<script type="text/javascript"><!--
google_ad_client = "pub-2151667935419035";
/* 234x60, created 7/17/08 */
google_ad_slot = "7918239589";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

<!-- End Here --> 

Open in new window

0
Comment
Question by:stargateatlantis
  • 3
  • 2
5 Comments
 
LVL 83

Expert Comment

by:leakim971
ID: 38420393
check this :
http://stackoverflow.com/questions/1142861/jquery-append-google-adsense-to-div

so just create three containers instead one where you put each script
0
 

Author Comment

by:stargateatlantis
ID: 38420409
hiding the banner violates google Terms of service any other ideas
0
 
LVL 83

Expert Comment

by:leakim971
ID: 38420412
if you're page is very long and you have the banner at the very bottom, so the user can't see it before using the scrollbar, do you violate the terms of service?
0
 

Author Comment

by:stargateatlantis
ID: 38420418
it does violate their tos there has to b a smart solution
0
 
LVL 83

Accepted Solution

by:
leakim971 earned 2000 total points
ID: 38420446
>it does violate their tos
Why? It's common to see banner at bottom

In this case, your question itself violate it too.
Assuming to move, we need to remove so hide... append to is remove, move.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses
Course of the Month15 days, 6 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question