Google Drive Download Counter and Direct Link

Kyle Gray

Summary: Google Drive Download Counter and Direct Link

Article by: Kyle Gray

Gray Technical, LLC – CEO

 

google-drive-ios

Google has many amazing features that it offers and all for free; Superb emails, amazing maps/directions and even an online drive that will allow you to store your data and share it. This ‘Google Drive’ can store up to 15GB for free and does not require you to create any special account in order to do so. In fact, we at Gray Technical utilize this drive for our software that is too large to be downloaded from our server directly.

We have found many advantages to using Google Drive but sadly it does lack in a couple areas. Something that we would like to have implemented into Google Drive is the addition of a download counter. We discovered work arounds that people have created, most notably with PDFs as shown in the blog link provided.

But what steps would you need to take in order to track downloads of ANY type of file? We have come up with our own solution which is to use Google itself.

How to add a download counter to Google Drive

As we mentioned before, Google has many neat features that it offers completely for free. One we are going to be utilizing is called Google URL Shortener. This nifty little online application does just what it says, it shortens a URL. When it shortens a URL it will provide you with a condensed URL of the one you previously provided it. If you are logged into your Google account however it will also save this URL in your history of that account and count the amount of times someone clicks on it.

While yes, this does not actually count the ‘downloads’ per say it will count how many times someone clicks on that link. Sadly, as many of you might know, when clicking on a Google Drive link it does not redirect you to an automatic download. This is the other problem we have with Google Drive, but like always there is way to change that.

Changing Google Drive link format to single link download

Once you upload your file and set the share properties to “Public” or “Anyone with the link” then you can change the URL to display a one click single link download of your file.

[UPDATE 8/21/17]

To change the share properties of your uploaded document first right click on the document and select ‘Share’. Inside the share option select ‘Advanced’, change the property to ‘Public’ or ‘Anyone with the link’ and click ‘Save’. Once saved you might also want to select ‘Prevent editors from changing access and adding new people’ before you click ‘Save changes’ and ‘Done’.

[END UPDATE EDIT]

When right clicking on the item in Google Drive select “Get shareable link”. This will display a download link for your file (in our case, a demo image).

https://drive.google.com/open?id=0B6XOERakQukvZ1BuSHFpeWFhZ0E

First, we have the Google Drive domain:

Google Drive Domain
https://drive.google.com/

Next is the options for download:

Google Drive Download Options
open?

And last is the ID of the file in which is going to be downloaded:

With this information we can modify the download link to provide us with a single click link for downloading. To do this change the “open” (ie. open download options) to “uc” (which selects the download option) and add “&export=download” to the end which tells google you want to download the file. The end result should look similar to this:

https://drive.google.com/uc?id=0B6XOERakQukvZ1BuSHFpeWFhZ0E&export=download

Adding the Google Drive Download Counter

With the direct download link the only part missing from this improved Google Drive system is the download counter. Take the newly created download link, go to the Google URL Shortener (https://goo.gl/) and create a short link for the item.

Shortened Link: goo.gl/Jw5RWS

 

With this new short link (if you are logged into your Google account) you can now generate QR codes, track your downloads and even graph them with the extended “Details” option (displayed as three vertical dots when hovering over your shortened URL) that Google gives you for free. Of course, this will only track the links on your shortened URL and not your actual file. However if the shortened URL is the only link that you provide then you will have a pretty good idea of the amount of hits your download generates.

 

Don't Forget

If you like this post and would like to subscribe to our newsletter to learn more about Gray Technical please follow this link.

As always if you would like to contact us for help or information please email us at support@graytechnical.com

Logo - Gray Tech 2 d