How do I see how many people have viewed a PDF on my website?

If you have a brochure on your website in PDF format then you can’t normally see how many times it has been opened in your analytics (if you don’t have Google Analytics installed then get it installed – its a free system and it will only take a developer 30 minutes to sort it out for you!)

That’s a shame,  because that’s quite important to know!

Edit the page containing the link to your PDF file then click the button to view source (if you have a WordPress website then click the TEXT tab – formerly known as HTML tab). Look amongst the undecipherable gibberish that us web developers work with on a daily basis for something like this:

< a href="">Open brochure< /a>

and then add – with a space in front if it – just before the first >
onClick=”_gaq.push([‘_trackPageview’, ‘/PDFs/brochure.pdf’]);”
where brochure.pdf is the name you want this to appear as in your analytics.

So that becomes:

< a href=""
onClick=”_gaq.push(['_trackPageview', '/PDFs/brochure.pdf']);”>
Open brochure< /a>

Then click back on the VISUAL tab or source button and save/update your page.

Now the number of times that people click on your brochure will appear as a page called PDFs/brochure.pdf in your Google analytics!

This entry was posted in Search Engine Optimisation (SEO), Web Design, Web Hints & Tips, WordPress Web Design and tagged , , , . Bookmark the permalink.

2 Responses to How do I see how many people have viewed a PDF on my website?

  1. Boyd says:

    I'm really loving the theme/design of your site. Do you ever run into any web browser compatibility issues? A few of my blog audience have complained about my site not operating correctly in Explorer but looks great in Chrome. Do you have any suggestions to help fix this problem?

    • Internet Explorer is one of the least compatible browsers out there – and also one of the least up to date. Microsoft have taken their eye off the ball, and have a release cycle of updates every 18 months, compared to Chrome & Firefox pumping out new features every couple of months. We just test carefully and try to allow sites to 'degrade gracefully' in IE. Luckily IE 10 has just been released for Windows 7 which is a 'good release' in that it fixes lots of latent bugs and brings the browser closer to the level of functionality of its competitors. It was also now 'update' from now on, so hopefully we won't end up with the situation we did with IE6 where there are people using almost 10 year old technology to view websites! Test carefully (use IE specific stylesheets to provide fixes) and be patient as things should get better!

About Gerald Thulbourn

Gerald Thulbourn setup WebSanity in 2004. He has a 1st class honours MEng in Microelectronics & Software Engineering (i.e. he's a techy), 5 A grades at A level (i.e. he works hard) and loves to communicate (i.e. odd for a techy). He hates tech speak, sloppy/badly tested code, and technology for the sake of technology's sake. He loves helping people understand marketing concepts and seeing how their application makes a real difference to their business. In particular he loves training; SEO, Website Analysis, WordPress etc. Read more about us on Google+