Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Loading second position adsense ad before first, how to?

Posted on 2013-02-05
4
Medium Priority
?
265 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 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
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 add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

636 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