Skip to content

Commit

Permalink
Track when modals are open (don't include email page template anymore)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Cobby committed Oct 10, 2012
1 parent c7bd3c8 commit edac5a0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 0 additions & 1 deletion templates/index.twig
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@
</div>
</div>

{% include 'email-page-form.twig' %}
{% include 'intro-modal.twig' %}
{% include 'about-tool-modal.twig' %}

Expand Down
13 changes: 12 additions & 1 deletion web/js/views/Application.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ TGM.Views.Application = Backbone.View.extend({

events: {
"click #at16ptx": "doNothing",
"click .googleplusone": "shareOnGooglePlus"
"click .googleplusone": "shareOnGooglePlus",
"show .about-tool,.extended-info": "onModalShow"
},

initialize: function()
Expand Down Expand Up @@ -75,6 +76,16 @@ TGM.Views.Application = Backbone.View.extend({
this.currentSize = newSize;
TGM.vent.trigger('resized', newSize);
}
},

onModalShow: function(e)
{
var $modal = $(e.currentTarget);

if ($modal.hasClass('modal')) {
var label = $modal.find('.modal-header h3, .modal-header h2').text();
_gaq.push(['_trackEvent', 'Modal', 'Show', label]);
}
}

});

0 comments on commit edac5a0

Please sign in to comment.