Log in

View Full Version : Tracking downloads from external sites


Artichoke Games
02-12-2004, 10:04 AM
As our first game is almost finished, I've been trying to set up a php system that would track downloads from download sites. What I want to do is to set a cookie with referer, so I can read it when a sale takes place. The problem is that download sites require direct links to executables, so setting a cookie becomes a problem.

I've come up with two solutions:
1. In .htaccess I add a handler so that .exe files are processed as php scripts. The script, game.exe for example, sets a cookie with data that interests me and returns valid game executable by setting apropriate headers and using @readfile. This solution is quite good, the only problem I see now are download managers displaying info 'server does not support resuming'.
2. Second solution is much worse. In .htaccess I redirect .exe file to .php script which sets a cookie and uses meta refresh to serve the file. This method supports resuming, but has obvious drawbacks - visible redirection and "right click and save as" returning html file.

Have anyone found any acceptable way to track downloads from external sites? I've searched through these forums and found some related info, but it didn't answer my questions. I've also read about dynamic pad files, but this looks too complicated and I'd rather use the cookie solution.

Any tips? Thanks in advance! :)

deadfeed
02-12-2004, 11:25 AM
They *require* a link directly to a downloadable file? I don't have much experience with this, but that seems kinda dumb. Why would they do that?

Another way to do it:

Different downloads for different sites. The executable then passes a hardcoded parameter via the in-game buy-now button, and you use that for tracking.

This obviously doesn't scale very well, but it does fit all the requirements.

Artichoke Games
02-14-2004, 10:13 AM
Different downloads for different sites - this is an option to consider, but preparing significant number of files is simply hard to do manually. Still looking for a more flexible solution... :)

damocles
02-15-2004, 07:42 AM
Um - if all the download sites are pointing to the executable on your server, can't you simply check your log files? It varies form server to server, but my server logs show the number of times the file has been downloaded and who referred to it.

Artichoke Games
02-15-2004, 02:29 PM
The problem is that I need something more than only logging that file was downloaded and where from. I also want to tie that fact to the user, so when he makes a sale, I can gather information on download sites that are profitable for my game.

damocles
02-15-2004, 04:43 PM
IP addresses? When they download the file, it should log their IP address. Then if you also have a full version installer fiel they need to download, you can log their IP again when they get the full version. If you are using a serial number system and a third party vendor - ask your vendor if they log IPs etc.

Guardian_Light
02-15-2004, 04:52 PM
There's a really good article on this very subject (tracking downloads from external sources) in the ASP newsletter this month. See http://www.asp-shareware.org

The overview of the idea is that you use URL rewriting (see Apache or IIS documentation) to dynamically rename your setup exe to something like Setup_1001.exe. For every download site, you use a separate number (0000-9999).

The magic happens when you read the setup file name at installation time, and then internally modify all web links in your program to pass the number when visiting websites. (URL = zzz.com?ID=1001)

Pros: More effective then cookies, and can be used with cookies too.

Cons: It can easily take a week or more to setup the basic system. Many weeks if you have a lot of download links, games, and external sources.

Michael Sikora
http://www.guardiangames.com

Artichoke Games
02-16-2004, 06:03 AM
@damocles
I thought about that. I will be tracking IPs, they can help identify the user when, for example, he deletes the cookie or reinstalls operating system.

@Guardian_Light
Thanks for the tip. I guess this is the method that deadfeed mentions. I get the idea, but unfortunately can't read the article, because I'm not ASP member (yet :D).

StAn
02-18-2004, 10:43 AM
I think that long-term tracking of IPs is useless, with so many dynamic IP users in the world...