<a href="http://www.example.com/files/map.pdf" onClick="javascript: pageTracker._trackPageview('/downloads/map'); ">click</a>
I can use the above google codes to track the pdf download.
But I want to have the track data insert into my own database.
This is the regular link
<a href="http://www.example.com/files/map.pdf" target="_blank">click</a>
Could I add some script to above codes that would act like one click go to two links?
One link open new window with the view of pdf. One link working in the background, send data to php script to track the download of this pdf.
There are some javascripts for this one click two links. But I am building this for a mobile site, so I want be conservative in the javascript usage.
Another approach is that I can take two steps.
1) <a href="download_map.php" target="_blank">click</a>
2) and in download_map.php, I record the download stats, and then redirect the browser to http://www.example.com/files/map.pdf.
But due to it is for mobile site, I want to keep everything clean and simple.
Any advices?
Thanks!