Copy link to clipboard
Copied
I have a client which operates a group association. They want to put their logos up for their members to download. Does anyone know how BC could track the number of downloads on each item? I was looking into putting the logo page into Secure Zone but that won't tell me which logo was downloaded. Any help appreciated.
I can't currently find a way in BC's Reports area to generate a report on the number of times a literature item was downloaded. So, if it were up to me, I'd use Google Analytics and their Event tracking to track how many times a piece of literature is downloaded. Technically, you can't really tell if it's been downloaded officially, but you could hookup some javascript on the link that leads to the literature download.
If you don't have Google Analytics tracking code installed, do so first. He
...Copy link to clipboard
Copied
I can't currently find a way in BC's Reports area to generate a report on the number of times a literature item was downloaded. So, if it were up to me, I'd use Google Analytics and their Event tracking to track how many times a piece of literature is downloaded. Technically, you can't really tell if it's been downloaded officially, but you could hookup some javascript on the link that leads to the literature download.
If you don't have Google Analytics tracking code installed, do so first. Here's some info on how to install the Google Analytics code: https://developers.google.com/analytics/devguides/collection/gajs/#quickstart
Once you have the Google Analytics code installed and verified, not it's time to add the event tracking feature. For my instructions I'm also going to assume you have jQuery already loaded on your site.
When you insert the Media Downloads/Literature module into the page you should see the default markup consists of a paragraph tag with the class of "literature-container" and inside each of those paragraphs is the link to download the literature. If we use jQuery, the script should look like this:
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery(".literature-container a").each(function() {
var litName = jQuery(this).text();
litName = jQuery.trim(litName);
jQuery(this).click(function() {
console.log(litName);
_gaq.push(['_trackEvent', 'Media', 'Download', litName]);
});
});
});
</script>
This jQuery script goes and finds every literature link and when that link is clicked will push an event to the _gaq variable and track the click as an event that you can find and report on using Google Analytics.
BC's reporting tools are basic and decent but if you want anything custom, I usually look to Google Analytics or other analytics offerings.
You can see my demo of this script in action at http://ignitemybusiness.com/demos/literature-event-tracking although technically, you cannot tell it works until the next day when you check your Google Analytics Events report.
Copy link to clipboard
Copied
Is anyone using this on a live site and can you confirm that it works? Does it actually provide download analytics by "litName" in Google Analytics? Any feedback would be appreciated.
Copy link to clipboard
Copied
Yup... I can confirm my code works. As I mentioned above, I installed it on my site on a demo page and today I checked my Google Analytics reports and did find that each download was tracked by "litName". Here's a screencast of what the report looks like in Google Analytics: https://dl.dropbox.com/u/2603799/screens/bc/Literature-Items-to-GA-Events.swf
You can see that it uses the "Event Label" to show the name of the file that was downloaded. If you have many literature items, you can choose to rename the category from "Media" to "Logo" and to make other categories using javascript as well, but if it's just the logos and a few other media items then you can run with the "Media" event name.
Copy link to clipboard
Copied
Thank you for your post. This was exactly what I was looking for. The only issue I seem to be having is, in FireFox and Chrome, it only counts the first link I download, and ignores all others (for that day, it appears).
Thank you in advance,
Melody
Copy link to clipboard
Copied
Hmmm... there's nothing in my code to suggest that it should behave that way. When the DOM is ready, the script finds all the literature links on the page and then for each link it sets up a click event that tracks the event in GA. As long as you don't have any other javascript issues on your site (Press Ctrl-Shift-J in Chrome/PC or Cmd-Shift-J on Chrome/Mac) and don't see any red JS errors it should work fine.
Another thing that could affect it is if you have some other JS that is manipulating the DOM and those library links maybe they get unhooked but that's unlikely. I'm not sure why that's the case but try it from another computer on another network-- maybe you're IP address is not being tracked-- for our clients we have our IP addresses from the office blocked from GA reporting-- but that's probably not your case. Probably JS errors. Do you have a URL?
Copy link to clipboard
Copied
I do have a lot of js on the site.... and I'm not in expert at it... here is the one page I've inserted the code on...... http://www.lakos.com/lakos-documents/literature
Copy link to clipboard
Copied
If I hit F5 to refresh and then click on another link, it will then count it... is there a way around that? In IE it counts link downloads as it should....
Copy link to clipboard
Copied
Thank you for your reply.... your code works great! After letting 24hrs go by looks like the analytics are updating properly... Thanks again!
Melody
Copy link to clipboard
Copied
Is there a way to insert another category for which webpage the download came from?