Track hits on a link?

Discussion in 'HTML' started by Mabden, May 20, 2004.

  1. Mabden

    Mabden Guest

    I have a page that has a game on it, and I want to track how many people
    download the file. I know how to track hits to the page, but can I track
    clicks on the link itself?

    Site: http://www.sitenook.com/
    Link: http://www.sitenook.com/ishido.zip

    The link is a Palm PDA game, so don't waste your time if you don't have a
    color Palm device.

    --
    Mabden
     
    Mabden, May 20, 2004
    #1
    1. Advertising

  2. Mabden

    brucie Guest

    1. Advertising

  3. Mabden

    Mabden Guest

    "brucie" <> wrote in message
    news:...
    > in post: <news:fAZqc.51505$>
    > Mabden <> said:
    >
    > > can I track clicks on the link itself?

    >
    > http://www.hotscripts.com/PHP/Scripts_and_Programs/Click_Tracking/
    > http://www.hotscripts.com/Perl/Scripts_and_Programs/Click_Tracking/
    > http://www.hotscripts.com/ASP/Scripts_and_Components/Click_Tracking/
    >
    >

    Kisses brucie, but those seem like whole apps, some costing $100. The
    freebie I looked at had about 10 ASP scripts with logins, mySQL stuff, and
    everything. Way overkill for my little Palm PDA game (a seen on
    http://www.sitenook.com/ ).

    I guess I could make the link go to its own asp file and use some
    server-side redirect. So my new question is how can I "force" or "push" a
    download from an ASP file.

    index.htm has:
    <a href=http://www.sitenook.com/ishido.asp> Download Ishido.Zip </a>

    ishido.asp has:
    Dim referer, browser, ip
    referer = Request.ServerVariables ("HTTP_REFERER")
    browser = Request.ServerVariables ("HTTP_USER_AGENT")
    ip = Request.ServerVariables ("REMOTE_ADDR")

    ' code to save this stuff, I get this

    ' code to push the zip - How?

    Just a hint would do...

    --
    Mabden
     
    Mabden, May 20, 2004
    #3
  4. Mabden

    brucie Guest

    in post: <news:Tr_qc.69800$>
    Mabden <> said:

    > Kisses brucie, but those seem like whole apps, some costing $100.


    asp Creating a Click-Through Tracking System tutorial
    http://www.4guysfromrolla.com/webtech/012901-1.shtml

    > The freebie I looked at had about 10 ASP scripts with logins, mySQL
    > stuff, and everything.


    you need something to store the stats, if not a db then a flatfile.

    > I guess I could make the link go to its own asp file and use some
    > server-side redirect. So my new question is how can I "force" or "push" a
    > download from an ASP file.


    no forcing or pushing involved. you just link to the script passing a
    variable to identify the file the visitor wants to download (assuming
    there is more than one file to download) not to the downloadable file
    itself. once the script has done its goodies it sends a location header
    to the requested file.

    --
    b r u c i e
     
    brucie, May 20, 2004
    #4
  5. Mabden

    Mabden Guest

    "brucie" <> wrote in message
    news:...
    > in post: <news:Tr_qc.69800$>
    > Mabden <> said:
    >
    > > Kisses brucie, but those seem like whole apps, some costing $100.

    >
    > asp Creating a Click-Through Tracking System tutorial
    > http://www.4guysfromrolla.com/webtech/012901-1.shtml
    >
    > > The freebie I looked at had about 10 ASP scripts with logins, mySQL
    > > stuff, and everything.

    >
    > you need something to store the stats, if not a db then a flatfile.
    >
    > > I guess I could make the link go to its own asp file and use some
    > > server-side redirect. So my new question is how can I "force" or "push"

    a
    > > download from an ASP file.

    >
    > no forcing or pushing involved. you just link to the script passing a
    > variable to identify the file the visitor wants to download (assuming
    > there is more than one file to download) not to the downloadable file
    > itself. once the script has done its goodies it sends a location header
    > to the requested file.
    >



    Maybe I didn't get what you were saying? If so bear with me...

    I don't think I'm explaining what I mean. I have no problem tracking the
    users who hit my site. A flat text file is fine, as I use a Perl script to
    view hits. But now I have added a link to a zip file (one zip file,
    containing one file). I want to know when someone has clicked on the
    download link, which just downloads the file. I realize I could make a
    second page that the link goes to, so I can use ASP to write more info to a
    file (DB, flat file, whatever), but the point is, the user has clicked on a
    link and expects it to "just download". They don't want to have to click
    ANOTHER link to "really" download the file. I just want to capture the fact
    that they clicked on the original link on my main page.

    > ...it sends a location header to the requested file.

    This may be the piece I need. But I don't understand what this means.


    I'm guessing that there's no way. I hoped someone would tell me about a
    JavaScript onclick function or
    something...


    --
    Mabden
     
    Mabden, May 20, 2004
    #5
  6. Mabden

    brucie Guest

    in post: <news:U1%qc.69804$>
    Mabden <> said:

    >> no forcing or pushing involved. you just link to the script passing a
    >> variable to identify the file the visitor wants to download (assuming
    >> there is more than one file to download) not to the downloadable file
    >> itself. once the script has done its goodies it sends a location header
    >> to the requested file.


    > Maybe I didn't get what you were saying?


    <a... /download.asp>

    1. visitor clicks link

    download.asp file:

    2. get the variables you want (IP, referer etc)
    3. open stats file
    4. write variables to stats file not forgetting to increment count by 1.
    5. close file.
    6. send a location header for the file being downloaded at the end of
    your script to the browser (in php it looks like this):

    header("location: http://www.example.com/the-file.zip");

    7. browser downloads file
    8. write a script to read and format your stats file so it looks pretty.

    > the user has clicked on a link and expects it to "just download".


    thats what happens with the above, your fun giggly stats thingy is
    transparent to the visitor. they click the link the file starts
    downloading. easy.

    > I hoped someone would tell me about a JavaScript


    JS isn't suitable for this.


    --
    b r u c i e
     
    brucie, May 20, 2004
    #6
  7. Mabden

    Mabden Guest

    "brucie" <> wrote in message
    news:...
    > in post: <news:U1%qc.69804$>
    > Mabden <> said:
    >
    > >> no forcing or pushing involved. you just link to the script passing a
    > >> variable to identify the file the visitor wants to download (assuming
    > >> there is more than one file to download) not to the downloadable file
    > >> itself. once the script has done its goodies it sends a location header
    > >> to the requested file.

    >
    > > Maybe I didn't get what you were saying?

    >
    > <a... /download.asp>
    >
    > 1. visitor clicks link
    >
    > download.asp file:
    >
    > 2. get the variables you want (IP, referer etc)
    > 3. open stats file
    > 4. write variables to stats file not forgetting to increment count by 1.
    > 5. close file.
    > 6. send a location header for the file being downloaded at the end of
    > your script to the browser (in php it looks like this):
    >
    > header("location: http://www.example.com/the-file.zip");
    >
    > 7. browser downloads file
    > 8. write a script to read and format your stats file so it looks pretty.
    >
    > > the user has clicked on a link and expects it to "just download".

    >
    > thats what happens with the above, your fun giggly stats thingy is
    > transparent to the visitor. they click the link the file starts
    > downloading. easy.
    >
    > > I hoped someone would tell me about a JavaScript

    >
    > JS isn't suitable for this.
    >


    Well that's fantastic! I've never heard of the location header. I will look
    into it and I think it will work great. I'm assuming ASP can do the same
    thing as PHP (since it's all HTML at the browser end)! Thanks very much for
    the hand-holding. I'm always amazed at getting a straight (excuse the
    expression) answer on a
    newsgroup. ;?)

    --
    Mabden
     
    Mabden, May 20, 2004
    #7
  8. Mabden

    brucie Guest

    in post: <news:DI%qc.69807$>
    Mabden <> said:

    > Well that's fantastic!


    and easy peasy

    > I've never heard of the location header.


    14.30 Location
    The Location response-header field is used to redirect the recipient
    to a location other than the Request-URI for completion of the
    request or identification of a new resource. [...]
    http://www.ietf.org/rfc/rfc2616.txt

    > Thanks very much for the hand-holding.


    i cant wait until we get to the heavy petting.

    --
    b r u c i e
     
    brucie, May 20, 2004
    #8
  9. Mabden

    Mabden Guest

    "brucie" <> wrote in message
    news:...
    > in post: <news:DI%qc.69807$>
    > Mabden <> said:
    >
    > > Well that's fantastic!

    >
    > and easy peasy
    >
    > > I've never heard of the location header.

    >
    > 14.30 Location
    > The Location response-header field is used to redirect the recipient
    > to a location other than the Request-URI for completion of the
    > request or identification of a new resource. [...]
    > http://www.ietf.org/rfc/rfc2616.txt
    >
    > > Thanks very much for the hand-holding.

    >
    > i cant wait until we get to the heavy petting.
    >


    <blushing>
    Gee, no one ever asked before. But I feel like such a newbie...

    Will you still respect my code in the morning...

    --
    Mabden
     
    Mabden, May 20, 2004
    #9
  10. Mabden

    Whitecrest Guest

    In article <nc0rc.69809$>,
    says...
    > > > Thanks very much for the hand-holding.

    > > i cant wait until we get to the heavy petting.

    > <blushing>
    > Gee, no one ever asked before. But I feel like such a newbie...


    Ohhhh.... a virgin.....

    --
    Whitecrest Entertainment
    www.whitecrestent.com
     
    Whitecrest, May 20, 2004
    #10
  11. Mabden

    brucie Guest

    in post: <news:>
    Whitecrest <> said:

    >>>> Thanks very much for the hand-holding.
    >>> i cant wait until we get to the heavy petting.

    >> <blushing>
    >> Gee, no one ever asked before. But I feel like such a newbie...


    > Ohhhh.... a virgin.....


    i saw him first!

    --
    b r u c i e
     
    brucie, May 20, 2004
    #11
  12. Mabden

    Mabden Guest

    "brucie" <> wrote in message
    news:...
    > in post: <news:>
    > Whitecrest <> said:
    >
    > >>>> Thanks very much for the hand-holding.
    > >>> i cant wait until we get to the heavy petting.
    > >> <blushing>
    > >> Gee, no one ever asked before. But I feel like such a newbie...

    >
    > > Ohhhh.... a virgin.....

    >
    > i saw him first!
    >


    .... I was hoping for the Dormouse...

    --
    Mabden
     
    Mabden, May 20, 2004
    #12
  13. Mabden

    Dennis Marks Guest

    In article <fAZqc.51505$>, Mabden
    <> wrote:

    > I have a page that has a game on it, and I want to track how many people
    > download the file. I know how to track hits to the page, but can I track
    > clicks on the link itself?
    >
    > Site: http://www.sitenook.com/
    > Link: http://www.sitenook.com/ishido.zip
    >
    > The link is a Palm PDA game, so don't waste your time if you don't have a
    > color Palm device.


    Why not just transfer to a new web page that has it's own counter and
    starts the download automatically. Many archives use a method like
    that. There is a message stating that if download doesn't start
    automatically please click here.

    --
    Dennis Marks
    http://www.dcs-chico.com/~denmarks/
    To reply change none to dcsi.


    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
     
    Dennis Marks, May 20, 2004
    #13
  14. Mabden

    Greg Schmidt Guest

    On Thu, 20 May 2004 08:00:11 GMT, Mabden wrote:

    > I have a page that has a game on it, and I want to track how many people
    > download the file. I know how to track hits to the page, but can I track
    > clicks on the link itself?
    >
    > Site: http://www.sitenook.com/
    > Link: http://www.sitenook.com/ishido.zip
    >
    > The link is a Palm PDA game, so don't waste your time if you don't have a
    > color Palm device.


    Do your logs not already show how many hits ishidio.zip has had? Seems
    like this information should already be at your fingertips.

    --
    Greg Schmidt
    Trawna Publications http://www.trawna.com/
     
    Greg Schmidt, May 20, 2004
    #14
  15. Mabden

    Mabden Guest

    "Dennis Marks" <> wrote in message
    news:200520040648229423%...
    >
    > Why not just transfer to a new web page that has it's own counter and
    > starts the download automatically. Many archives use a method like
    > that. There is a message stating that if download doesn't start
    > automatically please click here.
    >


    Yes! Ok. ...and how do I start the download automatically?

    brucie suggested "The Location response-header field" which I'd never heard
    of, and I am going to look into next. Is that what you would use?

    --
    Mabden
     
    Mabden, May 20, 2004
    #15
  16. Mabden

    Mabden Guest

    "Greg Schmidt" <> wrote in message
    news:...
    > On Thu, 20 May 2004 08:00:11 GMT, Mabden wrote:
    >
    > > I have a page that has a game on it, and I want to track how many people
    > > download the file. I know how to track hits to the page, but can I track
    > > clicks on the link itself?
    > >
    > > Site: http://www.sitenook.com/
    > > Link: http://www.sitenook.com/ishido.zip
    > >
    > > The link is a Palm PDA game, so don't waste your time if you don't have

    a
    > > color Palm device.

    >
    > Do your logs not already show how many hits ishidio.zip has had? Seems
    > like this information should already be at your fingertips.
    >


    Well, I'm hosted by another company, not on my own box. They probably have
    all kinds of info, but I'm not paying them to share it with me. I was just
    looking to pop some data into a text file so I could count the number of
    d/l's without involving my hosting company. I've been given a hint that I
    should use "The Location response-header field" on a separate page. So I
    will try that. Any other advice?

    --
    Mabden
     
    Mabden, May 20, 2004
    #16
  17. Mabden

    brucie Guest

    in post: <news:TDarc.51722$>
    Mabden <> said:

    >> Why not just transfer to a new web page that has it's own counter and
    >> starts the download automatically. Many archives use a method like
    >> that. There is a message stating that if download doesn't start
    >> automatically please click here.


    > Yes! Ok. ...and how do I start the download automatically?


    somewhere on the new page:
    <iframe src="http://example.com/file.exe"></iframe>

    > brucie suggested "The Location response-header field" which I'd never heard
    > of, and I am going to look into next. Is that what you would use?


    not if you want to display a new page and then start a download
    automatically.

    --
    b r u c i e
     
    brucie, May 21, 2004
    #17
  18. Mabden

    Dennis Marks Guest

    In article <TDarc.51722$>, Mabden
    <> wrote:

    > "Dennis Marks" <> wrote in message
    > news:200520040648229423%...
    > >
    > > Why not just transfer to a new web page that has it's own counter and
    > > starts the download automatically. Many archives use a method like
    > > that. There is a message stating that if download doesn't start
    > > automatically please click here.
    > >

    >
    > Yes! Ok. ...and how do I start the download automatically?
    >
    > brucie suggested "The Location response-header field" which I'd never heard
    > of, and I am going to look into next. Is that what you would use?


    That is a good question. I never considered it. I just went to
    www.versiontracker.com to see what they do and the link points to the
    downloaded file but something server-side seems to also load a web
    page.

    That is beyond my knowledge.

    Is there a way to use <link> or <embed>? How is background music
    loaded. Can the same method be used? I'm just brainstorming. None of
    these may work.

    --
    Dennis Marks
    http://www.dcs-chico.com/~denmarks/
    To reply change none to dcsi.


    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
     
    Dennis Marks, May 21, 2004
    #18
  19. Mabden

    brucie Guest

    in post: <news:200520041655480954%>
    Dennis Marks <> said:

    >> Yes! Ok. ...and how do I start the download automatically?


    > That is a good question. I never considered it. I just went to
    > http://www.versiontracker.com to see what they do and the link points to the
    > downloaded file but something server-side seems to also load a web
    > page.


    they use a refresh header. non standard but seems to be supported by
    everyone although it can be disabled.

    > Is there a way to use <link>


    needs to be clicked

    > or <embed>?


    proprietary MS

    i think an <iframe> (over 10x10px so filters don't think its a webbug
    and kill it) or a refresh header would be the most reliable but a link
    to manually start should still be included.

    --
    b r u c i e
     
    brucie, May 21, 2004
    #19
  20. Mabden wrote:

    > Any other advice?


    Don't know much about ASP, but here's a Perl solution:

    ============== download.cgi ==============
    #!/usr/bin/perl
    $filename = 'foobar.zip';
    $size = (-s $filename);
    $n = `cat count-$filename`; $n++;
    system ("echo '$n' > count-$filename");
    print "Content-Type: application/zip\n";
    print "Content-Length: $s\n";
    print 'Content-Disposition: attachment; '
    . "filename=$filename\n\n";
    system("cat $filename");
    ==========================================

    Not 100% reliable (really needs to do some file locking), but should do
    the job.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
     
    Toby A Inkster, May 21, 2004
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Todd Bandrowsky

    Why all the server hits?

    Todd Bandrowsky, Jul 24, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    343
    Steve C. Orr, MCSD
    Jul 24, 2003
  2. Mike
    Replies:
    1
    Views:
    661
    S. Justin Gengo
    Aug 8, 2003
  3. Kevin Spencer

    Re: Link Link Link DANGER WILL ROBINSON!!!

    Kevin Spencer, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    865
    Kevin Spencer
    May 17, 2005
  4. Dos-Man
    Replies:
    5
    Views:
    1,263
    Augustus
    Mar 4, 2004
  5. Jean Paul Sartre

    keeping track of bad link traders

    Jean Paul Sartre, Jun 19, 2005, in forum: HTML
    Replies:
    1
    Views:
    408
    Lauri Raittila
    Jun 19, 2005
Loading...

Share This Page