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
-
Moz Crawled My Site. Now What?
Hey everyone! So Moz crawled my site and I passed it over to my dev team who's curious about what they should prioritize. Curious what everyone's thoughts are. Here are the issue types: Duplicate Content - Missing Title - Duplicate Title Tag - Redirect Chain - Title too long - Description too short - Missing Description - Missing h1 - Thin Content - URL Too Long - Has meta noindex Would love any assistance! Thank you!
Technical SEO | | inksoft_mm0 -
Changing site URL structure
Hey everybody, I'm looking for a bit of advice. A few weeks ago Google sent me an email saying all pages with any text input on them need to switch to https for those pages. This is no problem, I was slowly switching the site to https anyway using a 301 redirect. However, my site also has a language subfolder in the url, mysite.com/en/ mysite.com/ru/ etc. Due to poor work on my part the translations of the site haven't been updated in a long time and lots of the pages are in english even on the russian version etc. So I'm thinking of just removing this url structure and just having mysite.com My plan is to 301 all requests to https and remove the language subfolder in the url at the same time. So far the https switching hasn't changed my rankings. Am I more at risk of losing my rankings by doing this? Thanks!
Technical SEO | | Ruhol0 -
Best practice for eCommerce site migration, should I 301 redirect or match URLs on new site
Hi Guys, I have been struggling with this one for quite some time. I am no SEO expert like many of you, rather just a small business owner trying to do the right thing, so forgive me if I say something that makes no sense 🙂 I am moving our eCommerce store from one platform to another, in the process the store is getting a massive face lift. The part I am struggling with is whether I should keep my existing URL structure in place or use 301 redirects to create a cleaner looking URLs. Currently the URLs are a little long and I would love to move to a /category/product_name type format. Of course the goal is not to lose ranking in the process, I rank pretty well for several competitive phrases and do not want to create a negative impact. How would you guys handle this? Thanks, Dinesh
Technical SEO | | MyFairyTaleBooks0 -
Robots.txt file
How do i get Google to stop indexing my old pages and start indexing my new pages even months down the line? Do i need to install a Robots.txt file on each page?
Technical SEO | | gimes0 -
Trying to get google to know my site is a magazine site is this wrong
Hi, i have put a line to describe what my site is at the top of my site and i want to know if this is wrong or not. We have dropped frok being number one in google for lifestyle magazine to now number seven. Before we had to redo our site we were number one and then we dropepd to around number four when we finished the site and now we are number seven and i need to try and get back up there. To help google know we are a lifestyle magazine i have put a line at the top of the site and i want to know if this looks out of place and if i should take it down. i need advice on how to get google to know we are a lifestyle magazine and get back in the top five of google my site is www.in2town.co.uk any help would be great
Technical SEO | | ClaireH-1848860 -
Video submission sites
Hello, What are the top 5 sites for video submissions ? Any suggestions about which points should be taken into consideration when submitting videos ? Thanks
Technical SEO | | seoug_20050 -
Canonical on ecommerce site
I have read tons of guides about canonical implementaiton but still am confused about how I should best use it. On my site with tens of thousands of urls and thousands of afiiliates and shopping networks sending traffic, is it smart to simply add the tag to every page and redirect to the same url. In doing this would that solve the problem of a single page having many different entrances with different tracking codes? Is there a better way to handle this? Also is there any potential problems with rolling out the tag to all pages if they are simply refrencing themselves in the tag? Thanks in advance.
Technical SEO | | Gordian0