Track PDF files downloaded from my site
-
I came across this code for tracking PDF files
[1. map.pdf ( name of PDF file ) and files is the folder name. Am i right ?
2. What shall i be able to track using the code given above ?
a ) No. of clicks on links or how many persons downloaded the PDF files ?
3. Where in Google this report will be visible ?
Thanks a lot.](http://www.example.com/files/map.pdf)
-
Hi Atul, Following is the response to your queries. 1). 'Map.pdf' refers to the name of the pdf and 'file' refers to the directory in which it is stored. 2). Using the above code, you would be able to track the click on the links and not the downloads. For setting up event tracking for a pdf download, I would recommend you to place the following code within the code of your download link onClick="_gaq.push(['_trackEvent', 'download', 'Pdf', 'Mypdfname',, true]);" Thus, the final download link would look like Download PDF Now that you have set up event tracking script in place, you now need to set up the event as a goal in Google Analytics. For that, follow the steps, 1. Open up the profile you wish to set up the goal in. 2. Click the gear icon in the upper right corner of the Google Analytics interface. 3. Click the Goals tab (in the sub-navigation just below where your Profile is listed) 4. Choose the Goal Set you wish to add the event to. 5. Name your goal and select the Event radio button. 6. Populate the following goal details: Category | that matches | download Action | that matches | Pdf Label | that matches | Mypdfname Value | that matches | 7. If you’ve added a Value in step 1, leave the “Use the actual Event Value” radio button selected. 8. Click “Save” and you’re ready to go! Hope, it might help! Cheers!
-
I doesn't. It does you a number of views, because there's a lot different solutions in internet browsers and plugins and user can even view it in Google docs viewer. But for many purposes it is sufficient to know that user view a document.
You can implement dedicated java script tool to know the number of downloads. Probably the code mentioned by nvs.nim (below) realizes such an action.
Good luck
-
Thanks.
Does the code gives me the number of downloads
how many persons have downloaded the PDF file or
how many times PDF file was downloaded.
-
Hi,
ad. 1it's part of url - address of file you have on serwer (to download) obviously it's example you can named it different
ad. 2 it's optional - look to my answer on 31/01 and you can read it on google WT help
Marek
-
Ok. Let me be very specific
You gave me the code -
[1. What does files/map.pdf means ?
2. Is label MyMap necessary or i can omit it
Thanks a lot for your patience :)](http://www.example.com/files/map.pdf)
-
Hi again,
First you should decide about tracking method. Next read Google article and finally ask us a specific not general question. I think it is fair advise
-
I am still not sure about the EXACT code. Can you please give me the code to track how many persons have downloaded PDF files from a site.
I will appeciate greatly
-
Hi Atul,
Did this answer your question, or do you still have questions about this topic?
-
Hi Steve,
Could you please tell me how? What specific technical solution you use?
Thanks, Marek
-
We track our PDF downloads via content. This way, we know how many of each particular one were downloaded.
-
It does not look right cos it was a virtual pageview tracking or mixture of both methods.
_trackPageview() creates a virtual directory structures and _trackEvent() creates an event...
-
Hi,
I think that it's better to use event tracking than virtual page-view tracking.
Syntax and parameters explanation
_trackEvent(category, action, opt_label, opt_value, opt_noninteraction)'```
[]);">Download](#)where: -category (required) - e.g. Maps (The name you supply for the group of objects you want to track.) - action (required) - e.g. Download (A string that is uniquely paired with each category, and commonly used to define the type of user interaction for the web object.) - label (optional) - e.g. EuropeMap or filename map.pdf (An optional string to provide additional dimensions to the event data.) - value (optional) - An integer that you can use to provide numerical data about the user event. It is very complicated to quick explanation and usage, you should read full article and additions like: Implicit Count. - non-interaction (optional) - set it for "true" (A boolean that when set to `true`, indicates that the event hit will not be used in bounce-rate calculation.) In this link you can read full google help article: http://code.google.com/apis/analytics/docs/tracking/eventTrackerGuide.html In your case syntax will be: [](http://www.example.com/files/map.pdf) [Then go to analytics to "Content" section of the reports and view Event Tracking an you will have: category: PDF Action: Download label: MyMap and count .... count how many events you have Wish you a huge number of downloads. M.](http://www.example.com/files/map.pdf)
-
Using this code will track all the files you offer to download: /** * Measuring GA Files */ var extensions = ['pdf','doc','docx','xls','csv','jpg','gif', 'mp3','swf','txt','ppt','zip','gz','dmg','xml']; var download_ga_folder = '/downloads/'; $('a').each(function(){ var _self = $(this); var u = $(this).attr('href'); if(typeof(u) != 'undefined'){ if(u.indexOf("?")!=-1){ uext = u.substring(0, u.lastIndexOf("?")); }else{ uext = u; }; var ext = uext.split('.')[uext.split('.').length - 1]; //check extensions for(i = 0; i < extensions.length; i++){ if(ext == extensions[i]){ _self.click(function(){ pageTracker._trackPageview(download_ga_folder + _self.attr('href')); return false; }); break; }; }; }; });
-
HI Aful,
Your event tracking anatomy does not look righ to me. Go here to see how to structure it correctly:
http://code.google.com/apis/analytics/docs/tracking/eventTrackerGuide.html#AnatomyReagrding where the data should render in Google Anlytics go to Content sub category events ,
Good luck!
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Similar pages on a site
Hi I think it was at BrightonSEO where PI DataMetrics were talking about similar pages on a website can cause rankings to drop for your main page. This has got me thinking. if we have a category about jumpers so: example.com/jumpers but then our blog has a category about jumpers, where we write all about jumpers etc which creates a category page example.com/blog/category/jumpers, so these blog category pages have no index put on them to stop them ranking in Google? Thanks in Advance for any tips. Andy
Technical SEO | | Andy-Halliday1 -
Has anyone tested or knows whether it makes a difference to upload a disavow file to both www. and non-www. versions of your site in GWMT?
Although Google treats both as separate sites, I always assumed that uploading the disavow file to the canonical version of your site would solve the problem. Is this the case, or has anyone seen better results uploading to both versions?
Technical SEO | | CustardOnlineMarketing0 -
Why can no tool crawl this site?
I am trying to perform a crawl analysis on a client's website at https://www.bravosolution.com I have tried to crawl it with IIS for SEO, Sreaming Frog and Xenu and not one of them makes it further than the home page of the site. There is nothing I can see in the robots.txt that is blocking these agents. As far as I can see, Google is able to crawl the site although they have noticed a significant drop in organic traffic. Any advise would be very welcome Regards Danny
Technical SEO | | richdan0 -
Google Site Search
I'm considering to implement google site search bar into my site.
Technical SEO | | JonsonSwartz
I think I probably choose the version without the ads (I'll pay for it). does anyone use Google Site Search and can tell if it's a good thing? does it affects in any way on seo? thank you0 -
Can the Hosting location of image files have a negative effect if 'off-site' such as on the devs own media server ?
Hi Can the Hosting location of image files have a negative effect if 'off-site' such as if they are on the developers own media server ? As opposed to on the actual websites server or file structure ? In the case i'm looking at the image files are hosted on a totally separate server (a media subdomain of the developers site server) from the subject sites dedicated server. Will engines still attribute the properties of files hosted in this manner to the main website (such as file name, alt attributes, etc etc) ? Or should they really be on the subject sites server own media folder ? Cheers Dan
Technical SEO | | Dan-Lawrence0 -
Google having trouble accessing my site
Hi google is having problem accessing my site. each day it is bringing up access denied errors and when i have checked what this means i have the following Access denied errors In general, Google discovers content by following links from one page to another. To crawl a page, Googlebot must be able to access it. If you’re seeing unexpected Access Denied errors, it may be for the following reasons: Googlebot couldn’t access a URL on your site because your site requires users to log in to view all or some of your content. (Tip: You can get around this by removing this requirement for user-agent Googlebot.) Your robots.txt file is blocking Google from accessing your whole site or individual URLs or directories. Test that your robots.txt is working as expected. The Test robots.txt tool lets you see exactly how Googlebot will interpret the contents of your robots.txt file. The Google user-agent is Googlebot. (How to verify that a user-agent really is Googlebot.) The Fetch as Google tool helps you understand exactly how your site appears to Googlebot. This can be very useful when troubleshooting problems with your site's content or discoverability in search results. Your server requires users to authenticate using a proxy, or your hosting provider may be blocking Google from accessing your site. Now i have contacted my hosting company who said there is not a problem but said to read the following page http://www.tmdhosting.com/kb/technical-questions/other/robots-txt-file-to-improve-the-way-search-bots-crawl/ i have read it and as far as i can see i have my file set up right which is listed below. they said if i still have problems then i need to contact google. can anyone please give me advice on what to do. the errors are responce code 403 User-agent: *
Technical SEO | | ClaireH-184886
Disallow: /administrator/
Disallow: /cache/
Disallow: /components/
Disallow: /includes/
Disallow: /installation/
Disallow: /language/
Disallow: /libraries/
Disallow: /media/
Disallow: /modules/
Disallow: /plugins/
Disallow: /templates/
Disallow: /tmp/
Disallow: /xmlrpc/0 -
Best SEO strategy for a site that has been down
Because of hosting problems we're trying to work out, our domain was down all weekend, and we have lost all of our rankings. Doe anyone have any experience with this kind of thing in terms of how long it takes to figure out where you stand once you have the site back up? what the best SEO strategy is for immediately addressing this problem? Besides just plugging away at getting links like normal, is there anything specific we should do right away when the site goes back up? Resubmit a site map, etc? Thanks!
Technical SEO | | OneClickVentures0 -
Duplicate content question with PDF
Hi, I manage a property listing website which was recently revamped, but which has some on-site optimization weaknesses and issues. For each property listing like http://www.selectcaribbean.com/property/147.html there is an equivalent PDF version spidered by google. The page looks like this http://www.selectcaribbean.com/pdf1.php?pid=147 my question is: Can this create a duplicate content penalty? If yes, should I ban these pages from being spidered by google in the robots.txt or should I make these link nofollow?
Technical SEO | | multilang0