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
-
Way to spider Wordpress site
I have an old Wordpress site and I want to move it to a new server and take it off Wordpress (too many hacks). I am trying to spider the site so as to get static, non-Wordpress, pages. I am having trouble doing this. When I spider the site, it changes the URLs. For instance, if the URL is www.domain.com/page/ the URL I get out of the spider is /page/index.html And those are not the URLs in the search engine indices. There are about 2000 pages on this site, so it is not feasible to set up 301 redirects. I tried using these spidering programs: WinHTTack Website Copier and PageNest Does anyone know of another method of turning a Wordpress site into a non Wordpress site?
Technical SEO | | DanCrean0 -
Does Site Structure Affect Google
Hi - I'm pretty new at this. We’re running an e-commerce affiliate site at http://www.mydomain.com. So we don’t take payments but customer gets passed through to third party sites when they select to buy a product. We have a blog at http://www.mydomain.com/news. I think Google is treating these 2 sites as as separate sites for PR. For this reason we're thinking about moving this to http://news.mydomain.com. Anyone have any experience in this?
Technical SEO | | richardjoseph0 -
Is there a pinging tool to ping all sites at once
hi, i am just wondering if there is a tool that you can put on your toolbar that allows you to ping all the sites at once. The last thing i want to keep doing is to go through every single one and ping my article. I would like to find a tool that does it all for me, can anyone let me know if there is one out there. many thanks
Technical SEO | | ClaireH-1848860 -
Have my site been penalised ?
Hi, I recently hired a link builder (who works for a digital marketing agency and wanted to earn some extra cash ) to do some link building for me on keyword Carpet Cleaner Hire Basically , May my ranking for this work has moved from 29 up to 13 , then down to 500 + and now up to 67 ?. It's been all over the place and I am worried that maybe google thinks its unnatural or to many links etc. I looked at some of the work this chap did and there was a log of bookmarks done , apparently to increase social awareness and some articles on random forums I never heard of but the articles didn't look to good and in my eyes were a little spammy.. I don't have any messages in WMT saying I have been penalised or anything but I am naturally worried that this chap may have caused damaged and that I was manually penalised. I have since asked him to stop immediately.. does this sound normal for the ranking to be all over the place in this manner when link building ? How can I tell if I have been manually penalized in any way ? What;s the general consensus ?. Should I contact google or leave it and see what happens ? Other keywords seems to be okay though. Any advice much appreciated. thanks Sarah.
Technical SEO | | SarahCollins1 -
Www. version of my site shows nothing in Open Site Explorer
When I first setup my site the domain was learnbonds.com. I moved hosts a couple of months ago and as part of the process I asked them to make the site show as www.learnbonds.com which they did. Now however when I goto www.learnbonds.com in open site explorer it says there is no data. When I enter learnbonds.com into open site explorer it gives me data but says that the site has been redirected to the www. version which shows no data. Also in google webmaster when I try to set the preferred domain as the www. version it gives me the following message: Part of the process of setting a preferred domain is to verify that you own http://www.learnbonds.com/. Please verify http://www.learnbonds.com/. I am concerned that this is hurting my SEO and would appreciate any advice you can give. Thanks Dave
Technical SEO | | fxtrader19790 -
What do the mozzers think about this site of mine?
Hello SEO MOzzers, I am today wanting your feedback on a site that I recently went live with. My Google rankings for the main keywords are doing very well considering the site has been live for 3 weeks now. I of course have a list of items that i'm still working on, completing meta description tags, title tags, adding copy content to category pages, updating h1 tags, working on our backlinking campaign, etc. The site is www.profitness-supplies.com Let me know what you think Mozzers
Technical SEO | | seohive-2227200 -
301 an old site to a newer site...
Hi First, to be upfront - these are not my websites, I'm asking because they are trying to compete in my niche. Here's the details, then the questions... There is a website that is a few months old with about 200 indexed pages and about 20 links, call this newsite.com There is a website that is a few years old with over 10,000 indexed pages and over 20,000 links, call this oldsite.com newsite.com acquired oldsite.com and set a 301 redirect so every page of oldsite.com is re-directed to the front page of newsite.com newsite.com & oldsite.com are on the same topic, the 301 occurred in the past week. Now, oldsite.com is out of the SERPs and newsite.com is pretty much ranking in the same spot (top 10) for the main term. Here are my questions; 1. The 10,000 pages on oldsite.com had plenty of internal links - they no longer exists, so I imagine when the dust settles - it will be like oldsite.com is a one page site that re-diretcts to newsite.com ... How long will a ranking boost last for? 2. With the re-direct setup to completely forget about the structure and content of oldsite.com, it's clear to me that it was setup to pass the 'Link Juice' from oldsite.com to newsite.com ... Do the major SE's see this as a form of SPAM (manipulating the rankings), or do they see it as a good way to combine two or more websites? 3. Does this work? Is everybody doing it? Should I be doing it? ... or are there better ways for me to combat this type of competition (eg we could make a lot of great content for the money spent buying oldsite.com - but we certainly wouldn't get such an immediate increase to traffic)?
Technical SEO | | RR5000 -
How do I set up a site review for a password protected site?
We need to conduct a SEO analysis for a website that is on a private, password protected development site -- is there anyway for SEOMoz tools to access and analyze a PW protected site? Thank you, Sara Merten
Technical SEO | | kev110