x404.co.uk
http://www.x404.co.uk/forum/

iTunes Store links (correct country)
http://www.x404.co.uk/forum/viewtopic.php?f=4&t=14795
Page 1 of 1

Author:  BigRedX [ Wed Sep 21, 2011 11:49 am ]
Post subject:  iTunes Store links (correct country)

The Dick Venom & The Terrortones single is going to be available from various digital download stores including iTunes and Amazon.

I want to include a link to these stores from our merchandise page and also in an email I'm currently building. However when I make the link using the iTunes Link Maker I have to specify a particular country's store.

Has anyone who has done this before know of any way to make a link that will direct people to the correct country store based on their location?

Author:  BigRedX [ Sun Sep 25, 2011 7:33 pm ]
Post subject:  Re: iTunes Store links (correct country)

No-one?

I miss the MacUser forum...

:-(

Author:  JJW009 [ Sun Sep 25, 2011 8:21 pm ]
Post subject:  Re: iTunes Store links (correct country)

It's non-trivial. You either have to rely on detecting the user's browser language settings or look up their IP in a table. Try Googling for "geolocation php script", first hit gives you this:

http://www.54bys.net/web-script/ip-addr ... cript.html

Quote:
Have you ever wondered how a web site identifies your location or country of origin and automatically redirects you to a different web content? . . .


Also found this: http://script.wareseeker.com/download/g ... 329a7fd4f7

That definitely works. Quick proof of concept here: http://x404.yourwired.net/

Using data from here: http://www.hostip.info/

Author:  JJW009 [ Wed Sep 28, 2011 12:22 am ]
Post subject:  Re: iTunes Store links (correct country)

OK now updated it to actually generate the itunes link for the UK, US and Japan. CBA to type the rest in and I'm sure there's a better way, but it seems to work:

Link: http://x404.yourwired.net/

Source:

Code:
<?php
   include 'GeoLocation.class.php';
   $geo = new GeoLocation($_SERVER['REMOTE_ADDR']);
   // instance now contains (city, country, longitude, lattitude) info
   echo "This checks your IP: $_SERVER[REMOTE_ADDR] against the hostip.info database to find the geographic information:<br />$geo->city, $geo->country ($geo->longitude, $geo->latitude)<br /> Now you know the country we can pick the url accordingly: <br /> ";
   
   echo "<a href=\"http://www.apple.com";
   switch ($geo->country) {
    case "UNITED KINGDOM":
        echo "/uk";
        break;
    case "JAPAN":
        echo "/jp";
        break;
    default:
        //anything else gets the US
       ;
    }
   echo "/itunes/download/\"> click for itunes </a>";
?>

Author:  BigRedX [ Wed Sep 28, 2011 8:24 am ]
Post subject:  Re: iTunes Store links (correct country)

Fantastic!

Thanks very much for your hard work. I hope to be able to use that on the web site. Unfortunately I had also hoped to use it in the email newsletter that the band sends out once a month, but with it requiring scripting that's a bit of a non-starter...

I don't know if it's just me thinking more globally than the downloads stores, but surely it would make more sense if this was implemented within the store itself. After all the internet allows you to reach people all over the world, and selling downloads is a way of being able to easily get our music to people who can't come to the gigs and buy a CD, and I would suspect that at least 50% of our download sales are going to be people who don't live in the UK.

Author:  JJW009 [ Wed Sep 28, 2011 8:37 am ]
Post subject:  Re: iTunes Store links (correct country)

A lot of websites do implement this automatically, just not iTunes - at least not from any of the pages I've been to.

You can still kind of use it in the mail shot, but you'll have to link to a website other than iTunes and have it redirect them. Of course that is only really practical if you can host the script somewhere the recipients trust - like the band's.

Hope it works out.

Author:  BigRedX [ Wed Sep 28, 2011 10:56 am ]
Post subject:  Re: iTunes Store links (correct country)

And neither do Amazon seemingly - the other download store that I want to link to!

Author:  gotimmy [ Wed Oct 26, 2011 8:16 pm ]
Post subject:  Re: iTunes Store links (correct country)

Is that you, Mike?

How about setting yourself up with an iTunes affiliate link, then setting up a webpage that links to that? That way you'll get a 4% kickback, and get stores by territory.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/