Target adverts for your blog visitors!

Do you show your members Google Adsense adverts? Most probably. Should you? Probably not.

Do you show different adverts for different times of the year? Probably not. Should you? Most probably.

Do you show adverts on older posts and not new ones? Probably not. Should you? Most probably.

These are three simple scenarios which can help you boost your advertising revenue on your blog with just a few simple scripts. Have you ever thought about showing adverts to users who arrive from search engines after searching for a specific word? For example, someone might search for ‘iPod Nano’ and your site might be indexed well for this term, they click the SERP result and arrive at your website, imagine you could display an advert which has to do with ‘iPod Nanos’ right in front of them? If you ask me, that’s damn useful and there’s no ways that won’t increase your revenue.

Let’s look at some code:

<?php
if (strstr($_SERVER['HTTP_REFERER'],”google”))
{
showAdverts($channel,$keyword);
}
?>

What this code does, is check whether the user visiting your website came from Google and then finds the keyword they searched and sends it, along with a channel, to your showAdverts() function.

The showAdverts() function would receive the two variables and display the adverts accordingly. The channel refers to the position on your blog, which the advert is to be shown and the keyword is to determine which advert to show. For this example, I would suggest using Amazon or the likes, where you can actually select an iPod Nano to display to your visitor.

What about dates, perhaps it’s a good idea to show certain adverts towards Christmas time when everyone is looking to buy gifts, rather than showing random Adsense adverts, let’s look at the code:

<?php
if (date(“F”)==”December”)
{
$keyword = “christmas”;
}
else
{
$keyword = “adsense”;
}
?>

What this snippet does, is determine whether it’s December and if it is, it’ll assign the value ‘christmas’ to the $keyword, which you’ll pass to your ShowAdverts() function and the relevant adverts will be displayed. If it’s not December, normal Adsense adverts can be displayed.

Nifty hey? :)

What about only showing adverts to visitors the first time they arrive? Once again, let’s peak at some code:

<?php
$expire = time() + (60 * 60 * 24 * 365);
if(isset($_COOKIE['ReturningVisitor']))
{
echo “Returning Visitor”;
}
else
{
setCookie(“ReturningVisitor”, “True”,$expire);
}
?>

The following code simply sets a cookie on the visitors computer and can then determine if the visitor is a new visitor or a returning one. Please note that this will only work should the visitor have cookies enabled. You’d slot your ShowAdverts() function call inside the first branch of the if statement.

There are so many things you’re able to do, what about checking the country that your user is in and showing relevant adverts? That could be a fantastic way to target, couldn’t it? :)

Combine all of these instructions together, set up your ShowAdverts() function accordingly and I have no doubt in saying that you’ll see a lovely increase in traffic!

Christopher is the founder of iMod - Most of his time is spent building websites and pushing the limits with Search Engine Optimization. You can follow him on Twitter @ChristopherM

Enjoy this post? Please tell a friend:

6 Comments on "Target adverts for your blog visitors!"

  1. Rustig says:

    Thanks Chris! It is still very foreign to me, but I am reading a book on basic php etc, so will copy this and play around. Not big into ads, but may come in handy some day.
    It is freezing here in Ireland!

  2. Chris M says:

    Still reading that book eh? ;)

    Freezing, really? It’s strange this side, we were whacked with more heat than I have ever experienced over the weekend, but things have calmed down now fortunately.

  3. Rustig says:

    Hi, do not mock the “old” and vulnarable! I grew up in the time of an abacus, so computers take longer to learn.
    By the way, very festive season for you and all the best for the new year ahead.

  4. Chris M says:

    I’m just teasing you mate, that’s it :)

    Hehe, have a fantastic festive season my friend and a fantastic beginning to the new year!

  5. Justin says:

    Nice article mate :)

    If there’s one thing I have learnt in my somewhat short but exciting online career it is that targeted advertising works bigtime..!

    No doubt you have heard of AdSense Section Targeting, have you ever experimented with it and if so was it worth implementing?

  6. Chris M says:

    Absolutely, targetting is the only way to make a success. Ah yes, I’ve heard of it, however I’m not experienced with it. I’ll do some research and prepare a blog post :)

Got something to say? Go for it!