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
Solved

Loading second position adsense ad before first, how to?

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
This article discusses four methods for overlaying images in a container on a web page
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…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

809 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