Getting started with the OpenLinkz search widget - read these posts and get up and running

Setting up OpenLinkz OpenLinkz Simplified Changing Appearance of Links OpenLinkz Cheat Sheet
Showing posts with label Blogger. Show all posts
Showing posts with label Blogger. Show all posts

How I used AdSense to debug my blog

I recently installed a widget on my blog and it turns out that it was causing intermittent problems in Internet Explorer.

I was able to detect this situation because I had several AdSense ads in various positions on the page. I have a link unit at the top of the page, a regular banner/text ad a little further down the page, a skyscraper in a sidebar and another link unit at the bottom of the page.

I also use Google Analytics to track traffic to the blog. The Analytics code is installed at the bottom if the page. Analytics showed what seemed to be a falling off of traffic but there were no clues as to why.

Looking at the AdSense reports, however, some hints began to emerge. When reviewing the performance of the various ad channels (each ad is set up as its own channel), anomalies began to appear. Lots of impressions for the ad at the top of the page, 20% less impressions for those ads further down the page. This tipped me off that the page was not rendering completely.

Knowing that the page was not rendering completely suggests that some active component on the page was hanging up the browser. Some testing in both FireFox and Internet Explorer soon narrowed the problem down to IE. Then I began to eliminate the most recent widgets added to the page (there weren't many) which soon led me to the problem.

In summary --

It doesn't hurt to put a few AdSense ads in various positions on your blog or web pages, especially unobtrusive link units. It is important, though, that each ad be set up with a separate channel. The AdSense reports can then be used to ensure that the pages are rendering completely. And, of course, you can also more precisely monitor how the various ad positions are performing for their primary purpose as ad inventory.

With all the Javascript that many blogs and web pages are carrying, it is not unusual for certain sections of pages to encounter problems. The fine grained reporting provided by AdSense provides a good way to monitor and troubleshoot your pages.

Posted by TradeRadarOperator at 9/28/2008 08:45:00 PM 0 comments  
Digg!



How to set up ads after each post in Blogger

For those of you who use Blogger as your blogging platform, you may be wondering how to set up ads after each post.

Blogger allows users to set up AdSense ads after each post. But what if you want to use ads from an affiliate network or ad network of your own choice? And especially, how do you display a different ad after each post when there are multiple posts on the page? Blogger doesn't have a built-in page element that supports that functionality.

This post explains how to do it. If you know a little Javascript, it won't be too hard for you to implement.

First, you need to decide how many posts you want to display on the homepage of your blog. For our example, let's say three posts will be displayed.

We then need to set up a counter that keeps track of which post is being displayed. Blogger will loop through posts until it hits the maximum number that you designated.

Add an HTML/Javascript page element to your blog. Add some script tags to it and implement the code for the counter, initializing it as follows:

var nPostCounter = 1

Create a function that will display your ads and enter it after the variable initialization described above. Our example does it as follows:

function rotatePostAd () {
}

Then add a set of IF statements that utilize the counter to display your ads in sequence:

function rotatePostAd () {

if (nPostCounter == 1) {

nPostCounter++;
} else if (nPostCounter == 2) {

nPostCounter++;
} else if (nPostCounter == 3) {

nPostCounter++;
}

}

Note that the code increments the counter each time a post is displayed on the page.

Then, we need to obtain the HTML or script for the three ads that will be displayed. The trick is to take the statements that cause the ad to be displayed and convert those statements to Javascript document.writeln statements. This is not as hard as it seems. Peter Bromberg has written an article at EggheadCafe titled "Convert HTML/Script to Javascript Include Source". The article includes a converter. Paste the code for an ad into the first text box, click the Convert button and retrieve the document.writeln statement from from the second text box. Then take the document.writeln statement and plug into our function. After doing this three times, our function will look like the following:

function adRotator () {
if (nPostCounter == 1) {
document.writeln('converted code for first ad... ')
nPostCounter++;
} else if (nPostCounter == 2) {
document.writeln('converted code for second ad... ')
nPostCounter++;
} else if (nPostCounter == 3) {
document.writeln('converted code for third ad... ')
nPostCounter++;
}

}

We now have a function that will display a different ad for each post. We now have to call the function from the appropriate place in the Blogger template. Go to the Layout tab in Blogger and click "Edit HTML". Click the "Expand Widget Templates" checkbox. Scroll down to the section that displays the labels for a post. Look for the following line of code:

<p class='post-footer-line post-footer-line-2'>

Just before the end tag for this <p> section, paste the following:

<script type="'text/javascript'">
rotatePostAd();
</script>

That's all there is to it!

Posted by TradeRadarOperator at 8/02/2008 09:36:00 PM 0 comments  
Digg!



 
Support our sponsors!
Close this ad panelX