Skip to content

Commit

Permalink
Merge pull request #1819 from AdrianGaudebert/959376-supersearch-anal…
Browse files Browse the repository at this point in the history
…ytics

Fixes bug 959376 - Track supersearch calls in Google Analytics.
  • Loading branch information
adngdb committed Jan 24, 2014
2 parents 067c034 + 22f4a8c commit bf29250
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions webapp-django/crashstats/base/templates/crashstats_base.html
Expand Up @@ -22,6 +22,18 @@
ga('send', 'pageview');
</script>
{% endif %}

<script>
// Track a page view in our analytics tracker. To be called by pages
// that use AJAX requests to load content.
{% if GOOGLE_ANALYTICS_ID %}
function socorroTrackUse(url) {
ga('send', 'pageview', url);
}
{% else %}
function socorroTrackUse(url) {}
{% endif %}
</script>
</head>
<body>
{{ browserid_info() }}
Expand Down
Expand Up @@ -61,6 +61,9 @@ $(function () {
catch (e) {}
contentElt.empty().append($('<div>', {'class': 'loader'}));

// If a tracker is available, track that AJAX call.
window.socorroTrackUse(url);

$.ajax({
url: url,
success: function(data) {
Expand Down

0 comments on commit bf29250

Please sign in to comment.