: Tracking clicks from a PDF to external URLs? I've published a small e-book in PDF format, which contains several embedded links to external URLs. I want to measure the clicks users make from
I've published a small e-book in PDF format, which contains several embedded links to external URLs. I want to measure the clicks users make from that offline PDF to those external URL destinations. NOTE: these outbound links will NOT be outbound from my website, but rather from the offline PDF.
GA Events is the typical way to track outbound links from a webpage, but how to execute this when the link instead originates in an offline PDF?
I tried sending each link from the PDF to a unique (but non-existent) URL on my own website domain, with a corresponding htaccess 301 redirect to the correct external URL. This functioned seamlessly for the user, but failed to track because a pageview never actually occurred on my site ...
Any suggestions?
More posts by @Goswami781
2 Comments
Sorted by latest first Latest Oldest Best
Instead of installing a database, as you already have the redirect setup, you should be able to collect the access logs on your HTTP server(s) (guessing Apache if you're using .htaccess?) and use any number of packages to analyze it. Things ranging from the free AWStats to (often paid) Splunk.
Of course this assumes you at least have access to the access log or are able to configure your server to produce one. (Some shared hosting providers may not give this to you)
To track clicks you could create a database which records the clicks. So something like what you have already done via unique url on your site. For each link create a row with link url (to redirect to) and click_id to know which to update.
example.com/track.php?click_id=2 redirects to google.com
example.com/track.php?click_id=2 redirects to yahoo.com
Once landed on example.com, track.php a script will update the database where click_id = 2 (increment) and then redirect.
There are loads of scripts available to do this for free heres some I found for you, havent tested with but looks like it'll do the job. The second has a live demo. Hopefully that helps.
www.phpdevtips.com/2011/07/simple-advanced-click-tracking-using-php-and-mysql/ http://www.phpjunkyard.com/php-click-counter.php
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.