Reputation: 63
Has anyone been able to include downloads within a custom report in Google analytics? I know I can get general/all events, but I just want downloads.
Thanks
Upvotes: 0
Views: 1440
Reputation: 7270
Google Analytics on Steroids offers a great _gasTrackDownloads hook in their API if you don't already have the tracking code in place per @Sheikh's more accurate Custom Report answer above.
Code Example:
<script type="text/javascript">
var _gas = _gas || []; // _gas instead of _gaq
_gas.push(['_setAccount', 'UA-YYYYYY-Y']); // REPLACE WITH YOUR GA NUMBER
_gas.push(['_setDomainName', '.mydomain.com']); // REPLACE WITH YOUR DOMAIN
_gas.push(['_trackPageview']);
_gas.push(['_gasTrackForms']);
_gas.push(['_gasTrackOutboundLinks']);
_gas.push(['_gasTrackMaxScroll']);
_gas.push(['_gasTrackDownloads']); // track downloads
_gas.push(['_gasTrackYoutube', {force: true}]);
_gas.push(['_gasTrackVimeo', {force: true}]);
_gas.push(['_gasTrackMailto']);
(function() {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = '//cdnjs.cloudflare.com/ajax/libs/gas/1.10.1/gas.min.js'; // new url
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
Link: Google Analytics on Steroids
Upvotes: 1
Reputation: 146219
If you are asking to track the downloads
then you can add _trackEvent
method in to the link that you want to track, like
Click <a onclick="_gaq.push(['_trackEvent', 'Downloads', 'Demo', this.href]);" href="downloads/google_dynamic_map.zip">here</a> to download with demo.
Above code is from my working site and I'm able to track download
of that file.
To view the report you can select the Contents->Events
menu from the left nav bar of your google analytics page.
In my link Downloads
is the Event Category
and Demo
is the Event Action
and this.href
is my Event Label
which gives me the url
of the file.
I've also created a custom report only to track Downloads
event category from Google's custom report option and can track it from that custom report, filtered by Downloads
.
content
menuUseful links here: Link One and Link Two and Event Tracking Guide.
Update: Also remember it'll take some time after you setup all of those things to track and see the result.
Upvotes: 1