Tracking PDFs through Google Analytics - google-analytics

I'm hosting a website through Github and I have pdf files hosted on it. The pdf file is accessed by directly using the URL and not by pressing a link. So, the only way to access the PDF is by typing http://website.com/resume.pdf.
I was wondering if its possible to use google analytics to see who visits the specific PDF file, and how to do it?

Google Analytics is usually implemented via clientsite (javascript) tracking code. Since you cannot embed that into a pdf document you cannot use it to track direct downloads.
What you can do (presumably, I'm not familiar with how Github hosting works) is to set up a "proxy" page that records the hit and then redirects the user to the download. You would redirect all requests to PDF files to this proxy page (via htaccess or similar) so your existing urls remain valid. Then you can track the hit (either via JS or serverside with the measurement protocol) and fetch the document based on the original request url.

Related

google analytics code in dynamic pages with embedded pdfs

i'm not a programmer. My website has dynamic web pages with embedded pdfs like http://www.indec.gob.ar/uploads/informesdeprensa/emi_10_16.pdf
According to Google Tag Assistant, the GA tracking code is inserted in most of my website http://www.indec.gob.ar, but it is not in the dynamic web pages with embedded pdfs.
Is it possible to insert the GA tracking code in all the dynamic web pages with embedded pdfs? How should I do it?
The Google Analytics javascript tracking code cannot be embedded in a pdf, so you are out of luck here.
A possible workaround would be not to have direct links to pdf documents but run requests through an html page that sends a tracking request before the user is redirected to the pdf. Easiest way would be to use a html page with the javascript tracker, or you might alternatively try some serverside download script that send a request via the measurement protocol.

pull Vimeo download link in wordpress post

I am a Vimeo Pro user and they have an option of downloading my videos. My concern so far is once i publish the video download URL in a membership site and a person distributes it over the web, i have no control over it but to delete the video itself.
I was told i can generate the download URL through the Vimeo API to come up with expiring download links. But when I tried to get a video download URL through the API playground, it seems it expires after a certain period of time. If I go this way, that means I have to replace my video download URL's in my wordpress site every time a URL expired.
Is there a way for me to pull the non-expiring download URL of the video but the users in my Wordpress site see an expiring download link when they click on it - like Amazon S3 download URLs?
If there is, what are the codes needed and where would I place the codes in Wordpress core files like functions.php etc?
Thanks for your help and instructions from the basic steps.
I can't give wordpress specific examples, but one way might be to create your own wordpress page that generates the download link, and redirects your user to the download link.
Then you can control access via the wordpress link

how to verify that google analytics is working correctly on a subdomain (no access to root domain)

I am trying to add google analytics to a project that is located under a subdomain. The subdomain has been was pointed to my my project by the domain owner, so I do not have access to the domain itself.
When I add the tracking code the status (shown under Property > Tracking Info)
Status: Tracking Not Installed
Last checked: 04-Jan-2014 00:00:05 PST
The Google Analytics tracking code has not been detected on your
website's home page. For Analytics to function, you or your web
administrator must add the code to each page of your website.
Is there any way to verify the tracking code is installed on the subdomain without having to access the domain root?
Although the tracking status is uninstalled, I am getting activity in Standard Reports > Realtime.
Does this mean that it is working despite the status report?
Am I likely to get correct tracking information with this setup?
You do not need access to the root domain and if the realtime statistics track traffic then most likely your GA setup works correctly. Most likey you did not implement the code at the place in the source code where Google expects it (which usually works but is still flagged as an error in verification).
If you use Google Chrome as browser you can additionally use two nice extensions to verify that your setup is correct:
Google Tag Assistant - verifys various Google Tags without mch detail
Google Analytics Debugger - provides some detail which data is sent to google, which plugins (e.g. ecommerce) are loaded by the analytics code etc.

Google Analytic Tracking for an entire server?

We currently use google accounts for our site ibiblio.org. Setting up the tracking on our landing pages is no big deal. But, we have tons of "collections" on our server, which as a public service, we allow a ton of users to host their own website installs (usually wordpress or wikis). Here is an example of a collection
These installs exist on a server, each install is a subfolder. Is there a way we can track the activity of these subfolders (or installs) without having to inject tracking code into each of their HTML files? We have a lot of contributors, so injecting code could get messy.
Thanks so much for your time and help.
There are ways, depending on the server's programming language, to create google analytics requests every page load (i.e. whenever page requests are fired). Tracking an entire site is not possible if the HTML files are served statically, because GA wouldn't know a page load happened.

Best way how to track iframe separately from the site on the same domain

On my site I have feature for users, that they can embed video on their page with iframe. Now I'm tracking classic page view and iframe view same way. So my analytics stats are not correct. I wanna separate this tracking to know how much of visitors I have on page and how much of them on iframe. I'm using google analytics.
I'm looking forward what do you suggest.
BTW: I am using special url for embeded video but still on the same domain.
Since you've got a special URL for the embedded video, you could use filters to include or exclude that URL for a Google Analytics profile, and keep the same analytics code on every page.
I'd recommend:
Keeping one profile unfiltered, showing all traffic
One profile that filters out the iframe URL
One profile that only shows the iframe URL
More info about Google Analytics accounts & profiles
Can you add a simple GET-Parameter in your URLs? For example: http://www.website.com/video.flv?type=embedded
or
http://www.website.com/video.flv?type=extern
Unfortunately I don't know exactly, how Google Analytics handles same URLs with various GET-Parameter.
Other way is using a simple redirect script or htaccess rule.

Resources