Forum Moderators: phranque
Any easy way to do this? I can create two SSI pages one with each program's affiliate code but how do I get the site to serve the right SSI page (include page) depending on the user's location?
Or is there another way this needs to be approached?
There are certain other problems you might encounter, too. For example, I'm not sure AOL UK users would use an IP address from a UK block, or via a US AOL block - which would mean AOL UK users receiving the US affiliate code.
You might want to look at a different approach. For example, if there is some sort of ordering process, you could split the UK and US visitors to a .co.uk and .com site respectively. However, without knowing your exact situation, it is difficult to make suggestions.
>>You will need to use a server-side scripting language (PHP, ASP...)
Aha, can this ASP thing you speak so highly of distinguish between the keyboard setting in Windows and take people to the UK affiliate program if they have a "UK English" keyboard? That's the only way I can definitely filter out the UK visitors (if it works). And then I'll let rest of world + dog go to the US affiliate program.
Someone once setup some asp pages for me in one of my Frontpage webs so I assume I can edit these ASP files in Frontpage but I don't have a database of IPs sorted into different columns for different countries.
If I know what's possible and what's not - and what's the best way - I will pay someone to do the job for me
>>However, without knowing your exact situation, it is difficult to make suggestions
While I can't post URLs I'll be happy to explain in a bit more detail. I've got a long established widgets.co.uk site that's going to stop selling widgets. It has 2000+ inward links and gets about 10K uniques a day and it would be a shame to let that go to waste. These widgets go for roughly 0.5 to $1 per click or $20 per sale. I'd like to post some content on the existing pages to "push" visitors towards other companies still selling widgets. There are plenty that offer affiliate programs but I haven't been able to find one that ships to both US and UK. So I'll have to present US visitors with a different link to what I provide to UK visitors. Does that help?
[edited by: Macro at 2:07 pm (utc) on Nov. 4, 2004]
I've just done a quick check on my records and about 90% of UK computers seem to have en-gb set, but the other 10% seem to have the US variety: 'en-us'.
I've got some very simple PHP which can do this:
<?php
if (strpos($_SERVER["HTTP_ACCEPT_LANGUAGE"], 'en-gb') !== FALSE) {
include 'gb-aff-code.inc'; // include for GB customers
}
else {
include 'us-aff-code.inc'; // include for the others
}?> If you are using ASP, it would be just as easy (but I don't know ASP, so you'd have to ask in the Microsoft forum).
The problem is that you can't insert asp code into a htm page (?). So I'll have to manually redirect 1500 htm pages to asp equivalents and then apply the code :(
No, I can't do what you guys call a mod rewrite. It's a Windows NT server with IIS
Are we talking about a dedicated server? If so, you could just have .htm files parsed for ASP.
Otherwise, you could simply use an
iframe which calls an ASP page which would display the banner/affiliate code. Anything other than renaming all the pages! <added>You may well be able to do this with Javascript, too, which may be even better for you.</added>
Does anyone know how to set up a banner that appears for the UK market and a different banner for the US market when you type in the domain url.
Therefore the banner that you see is generated by where you log onto the website.
No affiliates are involved. And the site in built in htm.
also... while looking at their site I just saw that GeoIP also has a mod_geoip apache module:
[maxmind.com...]
mod_geoip looks up the IP address of the client end user. If you need to input the IP address instead of simply using the client IP address, you will need to use another one of our APIs.
For the country database, mod_geoip sets two environment variables, GEOIP_COUNTRY_CODE and GEOIP_COUNTRY_NAME. For other databases, see the included README file.
==> your script could access these enviroment variables and go from there