Tracking .pdf downloads

I

Ioannis

I am interested in tracking certain .pdf downloads.
I have a tracker on my pages, but it doesn't work with .pdf.
Is there any way to have the .pdf file "wrapped" around in an html page
(which contains tracker code) so that when the reader clicks it, the .pdf
file starts downloading automatically?

Thanks much in advance,
 
J

Jan Harders

Ioannis said:
I am interested in tracking certain .pdf downloads.
I have a tracker on my pages, but it doesn't work with .pdf.
Is there any way to have the .pdf file "wrapped" around in an html
page (which contains tracker code) so that when the reader clicks it,
the .pdf file starts downloading automatically?

why don't you put a html-file on your server that contains the tracking-code
and a meta-refresh to the pdf. or, you could of course always take a look at
your log-files to see how often a pdf-file was requested.

greets,

jan
 
I

Ioannis

Ï "Jan Harders said:
why don't you put a html-file on your server that contains the tracking-code
and a meta-refresh to the pdf. or, you could of course always take a look at
your log-files to see how often a pdf-file was requested.

Thanks for the answer. I am not aware of what a "meta-refresh" is. Could you
elaborate please?

In other words, what kind of html code should the html page on the server
contain (apart from the tracker of course).
 
D

Dennis M. Marks

Weyoun the Dancing Borg said:
IOn your site, dont link to the pdf file directly. Link to a HTML page.
Call it what you want, but put the tracker software on it.


<html>
<head>
<title>Please Wait</title>
<meta http-equiv="Refresh" content="5;URL=www.url.com/file.pdf">
</head>

<body>

Please wait. Your browser is automatically being re-directed to the PDF
file. If it has not automatically done this within 5 seconds, please
click <a href="www.url.com/file.pdf">here</a>.


***INSERT TRACKER CODING HERE*** (or whereever it goes)


</body>
</html>
What if there was a delay at the tracker site making it take more than
5 seconds to count the access? Would the refresh take place without the
count?

In other words, does a refresh have priority over completion of the
page?
 
J

Jan Harders

Dennis M. Marks said:
What if there was a delay at the tracker site making it take more than
5 seconds to count the access? Would the refresh take place without
the count?

In other words, does a refresh have priority over completion of the
page?

Good question, but I think it'll not get us into problems.
The tracking-service propably runs as a cgi beeing called within an
image-tag, I guess. If so, the script is invoked when the browser completes
the request. That is, the user may then close the window, the script will
(most probably) finish and data will be written (tracking will be done).
another, more secure, alternative, would be, to put a javascript in the
body-tag, that will run onLoad and do a location.href-replacement. That one
would wait till the page is fully loaded, a meta-refresh won't, I guess.
 
W

Weyoun the Dancing Borg

Dennis said:
What if there was a delay at the tracker site making it take more than
5 seconds to count the access? Would the refresh take place without the
count?

It would, yes.



In other words, does a refresh have priority over completion of the
page?

it would take priority over other coding, such as a java applet or
whatever is used to make the counter - yes.

The way around that, is to increase the load time. Change it to 10
seconds :)
 
W

Weyoun the Dancing Borg

Jan said:
another, more secure, alternative, would be, to put a javascript in the
body-tag, that will run onLoad and do a location.href-replacement. That one
would wait till the page is fully loaded, a meta-refresh won't, I guess.

It's no less "secure" from a browser point of view, and Javascript has
the added disadvantage of "what if they have JavaScript disabled"?

I suppose, to get the best of both worlds - do it with Javascript for an
onLoad and then as a fall back have a Meta Refresh for 10 seconds :)

--

Quiet, Pinky; I'm pondering.
_ _
/~\\ \ //~\
| \\ \ // |
[ || || ]
] Y || || Y [
| \_|l,------.l|_/ |
| >' `< |
\ (/~`--____--'~\) /
`-_>-__________-<_-'
/(_#(__)#_)\
\___/__\___/
/__`--'__\
/\(__,>-~~ __)
/\//\\( `--~~ )
'\/ <^\ /^>
_\ >-__-< /_
(___\ /___)
 
R

rf

Agreed. I've already explored the ISP server logs options. It's not
feasible. My ISP doesn't release its logs, for some strange privacy
reason.

Your "isp" sounds like a bloody idiot. Get another one, it'l probably be
cheaper as well.

Cheers
Richard.
 
J

Jeff Thies

Ioannis said:
I am interested in tracking certain .pdf downloads.
I have a tracker on my pages, but it doesn't work with .pdf.
Is there any way to have the .pdf file "wrapped" around in an html page
(which contains tracker code) so that when the reader clicks it, the .pdf
file starts downloading automatically?

Have a server side script print:

Content-Disposition: inline; my_pdf_.pdf
Content-type: application/pdf

Then have it read the your pdf file and print that.

Don't forget to toss in a counter...

Jeff
 
J

Jan Harders

Weyoun the Dancing Borg said:
It's no less "secure" from a browser point of view, and Javascript has
the added disadvantage of "what if they have JavaScript disabled"?

I suppose, to get the best of both worlds - do it with Javascript for
an onLoad and then as a fall back have a Meta Refresh for 10 seconds
:)

True, true. And additionally we just add a "if you don't get redirected
within 10 seconds, please click here". What's the international stats on
javascript activated right now? We had a test on some of our websites (major
part is german traffic) and stats showed between 92 and 97% have js
enabled...
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top