Fix resource download event tracking js
This commit is contained in:
parent
b9879ad28d
commit
6d7aa555c3
|
@ -6,10 +6,9 @@ this.ckan.module('google-analytics', function(jQuery, _) {
|
||||||
},
|
},
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
jQuery('a.resource-url-analytics').on('click', function() {
|
jQuery('a.resource-url-analytics').on('click', function() {
|
||||||
var resource_prefix = this.options.googleanalytics_resource_prefix;
|
var resource_url = encodeURIComponent(jQuery(this).prop('href'));
|
||||||
var resource_url = resource_prefix + encodeURIComponent(jQuery(this).prop('href'));
|
|
||||||
if (resource_url) {
|
if (resource_url) {
|
||||||
_gaq.push(['_trackPageview', resource_url]);
|
_gaq.push(['_trackEvent', 'Resource', 'Download', resource_url]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue