Solved

Loading second position adsense ad before first, how to?

Posted on 2013-02-05
4
259 Views
Last Modified: 2013-02-05
My midpage adsense ad receives a higher ctr than my first (top) ad.

As per a suggestion from google, I would like to load my midpage ad first, so it uses the highest bid.

http://support.google.com/adsense/bin/answer.py?hl=en&answer=187769 

However, their example shows a way to set the ad into an absolute position on the page.

The way my page template works, the adsense ad is embedded in content. It appears after the fourth paragraph.

Is there a way I can put the ad code in a div and have it load prior to the others (as per their example) and then have a div that actually displays it in a way that it's not an absolute position, so I can do this:

paragraph-1
paragraph-2
paragraph-3
paragraph-4
<div> (show previously loaded ad here)</div>
paragraph-5
paragraph-6

Clear examples appreciated :) :)

Chris
0
Comment
Question by:St_Aug_Beach_Bum
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 38856615
it would be easier if you posted a link to the page so we can see how it is coded.  I am thinking that you could hold the add off by putting the code at the end of the page and putting the container in its normal place but empty, then just put the add into the innerHTML of the container.

The problem is it might make the load a little quirky and we will need to see the code to see if we can minimize the elements from jumping around during load.

Cd&
0
 

Author Comment

by:St_Aug_Beach_Bum
ID: 38856741
Hi Cd&,

Thank you for taking a look, an example is here: http://shoutkey.com/figure 

though the goal is to load that second (positioned) ad first, as google adsense places the highest bidder in the first spot to load. So if I were to load the other two ads at the end that might work...
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 500 total points
ID: 38856864
if in your code where you want an ad just put in an empty span with an id:
<span id="add1"></span>
One for each ad location.

The move the ad generation code to the end of the page into a set of hidden eleemnts using Display: none in the CSS.

Then you can move the add into the the span with
document.getElementById('ad1').innerHTML= document.getElementById('hiddenad1').inerHTML;

Cd&
0
 

Author Closing Comment

by:St_Aug_Beach_Bum
ID: 38857801
Thank you COBOLdinosaur!
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

688 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