Solved

Loading second position adsense ad before first, how to?

Posted on 2013-02-05
4
217 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
  • 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Image Orientation On Website 6 41
Make bootstrap pagination vertical 3 40
jQuery Time Off Event 20 42
Gradient CSS 4 13
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 Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

706 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now