coopersita
Member
Posted 1 year ago #
Hi,
Is there a plugin for rotating ads that can feed an ad based on the visitor's region?
For example, if a visitor is from the UK, they'd get the Amazon UK ad, while a person from the US gets the Amazon US ads?
But not only for Amazon, other affiliate networks as well?
Thanks
Sidney Harrell
Member
Posted 1 year ago #
Shouldn't be to hard. Couldn't find a wordpress function to get a visitor's IP address, but there is a straight PHP predefined variable that should help.
$_SERVER['REMOTE_ADDR'];
You would have to check it against a list of what IP blocks are assigned to different countries.
I got the idea from this rather defunct looking plug-in:
http://wordpress.org/extend/plugins/show-visitor-ip-address/
You might be able to start there and modify it to suit your needs.
coopersita
Member
Posted 1 year ago #
Thanks. We decided to just to US, at least for now, but will keep in mind.