Archive for March, 2007

Geo-Targeting with MaxMind’s GeoIP API

Geo-targeting is something I’ve wanted to figure out how to implement, but it’s also something I’ve had no need for.

That changed, however, when I was accepted into AzoogleAds publisher program. Azoogle has offers for both the US and International markets, but most offers are targeted to one or the other–not both. As such, to show multiple offers on a given page or website based on the user’s country I’ll need to implement a little geo-targeting.

The only website that receives any noticeable international traffic is Smart Capper. The handicapping tools receive a lot of non-sticky search engine traffic, so I’m going to use Azoogle to try and monetize that traffic.

The top three traffic sources I’m looking to monetize are the United States, United Kingdom, and Canada.

To do the geo-targeting for these locations I first tried to use hostip.info’s IP address database. I quickly realized, however, that their database is far from complete (it had no idea where I was located). As such, I needed to find an alternative.

The alternative: MaxMind’s GeoIP API.

To use the GeoIP API, you must have one of the GeoIP databases. MaxMind has a wide range of databases to choose from, but I chose their free GeoLite Country database, as I only need to get the user’s country, and 98% accuracy is fine for my traffic.

Once you’ve got the database of choice and the GeoIP API for the programming language you’re using, all you have to do is make the correct API call and you’ve got the information you need.

As an example, you can use the following code to get the country code for an IP address using the GeoIP API with PHP:

// include GeoIP PHP API
include("geoip.inc");

// open the GeoIP binary database
$gi = geoip_open("GeoIP.dat",GEOIP_STANDARD);

// $ip is an IP address
$country_code = geoip_country_code_by_addr($gi, $ip);

// Country codes:
// http://www.immigration-usa.com/country_digraphs.html
echo $country_code;

This made geo-targeting very easy, and based on the other databases MaxMind offers, they’ll be my first choice if I ever need more detailed information.

If you’re in need of geo-targeting and not sure where to start, then I hope this post has helped make things easier for you.

Tags: , ,

Does Your Blog Require a Login to Comment?

If you require that your reader’s login to comment on your blog then you might be missing out on valuable discussion.

As a reader, it’s a real pain when I want to leave a comment, but instead I’m presented with a You must be logged in to comment message.

I never quite realized how much of a pain this is when I started my sports handicapping blog in December of 2005, but I required that readers login to comment because of all the spam comments I was receiving (and deleting).

Since that time, however, I’ve come to know and love the power of Akismet for catching comment spam, and when you combine Akismet with the WordPress option to moderate any comments with links in them, you’re not likely to see any spam comments make it through with you seeing them first.

So if you require your readers login to comment, why exactly are you doing it? Are you hoping for little to no discussion?

Thankfully I don’t run into this too much, but while trying to comment on the AuctionAds blog about their new window targeting option I had to go through the mind numbing process of registering for an account just so I could leave a comment.

Don’t do that to your readers. Who knows how much valuable conversation you’re missing.

Tags: ,

Why Do You Show Your FeedBurner FeedCount?

Every couple of weeks (or so it seems) I come across a blog that mentions the drawbacks of showing your FeedBurner FeedCount before you have a large number of subscribers.

I most recently came across this topic at JohnTP.com and HarpzOn.com, and both of these websites agree with the popular consensus that showing your FeedBurner FeedCount when you’ve got few subscribers actually hurts you.

I don’t know about you, but I can only respond to this notion with:

Are You Kidding Me?

I fully agree with the idea that we live in a me too society, and that by showing you have a large number of subscribers a reader is more likely to subscribe to your feed based on this number alone (this is one of the reasons why I can’t believe I hadn’t heard of Copyblogger sooner).

I don’t, however, buy into the notion that showing your FeedCount when you’ve got a small number of readers will actually hinder your efforts in obtaining subscribers.

If someone doesn’t want to subscribe because I’ve only got 30 or so subscribers then this blog probably isn’t for them. I have subscribed to plenty of small blogs because of their content, not the size of their ego (I mean FeedCount).

This now leads me to the point of this post: Why do you show your FeedBurner FeedCount?

I show my FeedCount because I like giving everyone a rough idea as to how many subscribers I’ve got. When I say everyone I include myself, as I hate having to login to FeedBurner to see this stat.

Why do you show your FeedCount? Do you think that having a small FeedCount is hurting your efforts in obtaining subscribers?

Tags: , , , ,

Microsoft’s Live Search is Checking Your Website Using Unsavory Search Strings

Is Microsoft checking to see if your website contains perverse content by using unsavory search strings?

It sure seems so.

While running a quick check through my websites’ access logs this morning I came across an interesting line in the access log of a website I’m slowly developing:

131.107.0.95 - - [17/Mar/2007:10:45:07 -0400] “GET / HTTP/1.1″ 200 13016 “http://search.live.com/result.aspx?q=cumshot&mrt=en-us&FORM=LVSP” “Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; Win64; x64; SV1)”

If you’re having a hard time deciphering this line, here’s what it says: someone accessed my website using a referrer from Microsoft’s live.com using the query string of cumshot. What’s interesting to note, however, is that the referrer line is invalid, as the live.com search application isn’t result.aspx, it’s results.aspx.

Let me first say that I’ve seen websites request pages with their own website’s URL as the referrer string to try and get people to visit their website, but this is obviously not one of those cases as it sends me to live.com, not somerandompornsite.com.

Having no idea how someone would find Probability Calculators by searching for cumshot, I decided to dig a little deeper to see what was going on.

Doing a lookup on the IP address, 131.107.0.95, I get:

nslookup 131.107.0.95 ns1.msft.net
Server: ns1.msft.net
Address: 207.68.160.190#53

95.0.107.131.in-addr.arpa name = tide525.microsoft.com.

If you’ve never done an nslookup before, it’s basically saying that this IP address belongs to Microsoft, and Microsoft is giving me the authoritative answer.

Doing a reverse lookup on tide525.microsoft.com yields the same IP address, so it’s a good match.

Now the only question left is: Why?

Why is Microsoft doing this? Some websites take the searcher’s query string to provide targeted content to the user, but why is Microsoft checking for this query string? Is it really that hard to determine if a site is targeted to an adult audience?

To be honest, I’ve got no problem with unsavory search strings, but I doubt everyone feels the same way as I do, so I wanted to write this post. Have you seen this in your own access logs? Do you even care that Microsoft is doing this?

Let me know what you think.

Tags: , , , , , ,

Show Unread Comments: Version 1.1

Ask and you shall receive: I’ve updated my Show Unread Comments WordPress plugin to incorporate a few suggestions from people just like you.

The first change made to the plugin is actually a bug fix. With the initial version, the statuses of comments on pages were not marked appropriately, and status indicators were not showing up next to comments on pages. This has been fixed, so you’ll now see comments being tracked properly on pages.

The next change made to the plugin is the most popular feature request: the ability to return a binary value with show_unread_comment_status().

Now all you have to do is pass bin for $type and you’ll be returned true if the comment has been read and false if the comment is unread. This should make dynamically updating CSS for read and unread comments a snap.

Make sure you visit the Show Unread Comments page to get all the intimate details.

If you’re in a hurry you can download the latest version of the plugin at:

http://www.ryanjparker.net/files/show-unread-comments.zip

I’ve still got one more feature I’d like to get implemented, and that’s for the ability to create a direct link to the oldest unread comment when you’re viewing a given post or page, so if you’ve got any other feature requests or find a bug make sure you comment below or contact me so I can make sure to include it in the next version!

Tags: , , , ,