Skip to content

Commit

Permalink
[#2375] Add the correct template
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Aug 17, 2012
1 parent 01a0462 commit 1706b36
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 30 deletions.
30 changes: 0 additions & 30 deletions ckan/templates/snippets/internal-tracking.html

This file was deleted.

24 changes: 24 additions & 0 deletions ckan/templates/snippets/internal_tracking.html
@@ -0,0 +1,24 @@
<script type="text/javascript">
$(function (){
// Tracking
var url = location.pathname;
// remove any site root from url
console.log($('body').data('site-root'));
url = url.substring($('body').data('locale-root'), url.length);
// trim any trailing /
url = url.replace(/\/*$/, '');
$.ajax({url : $('body').data('site-root') + '_tracking',
type : 'POST',
data : {url:url, type:'page'},
timeout : 300 });
$('a.resource-url-analytics').click(function (e){
var url = $(e.target).closest('a').attr('href');
$.ajax({url : $('body').data('site-root') + '_tracking',
data : {url:url, type:'resource'},
type : 'POST',
complete : function () {location.href = url;},
timeout : 30});
e.preventDefault();
});
});
</script>

0 comments on commit 1706b36

Please sign in to comment.