Permalink
Browse files

Track clicks on mark as read button.

  • Loading branch information...
1 parent b672f18 commit ce98854aec4f9a9875559e863d82135cbb57f032 @swege committed Jul 21, 2013
Showing with 5 additions and 1 deletion.
  1. +3 −0 background.js
  2. +2 −1 read_button.js
View
@@ -52,4 +52,7 @@ chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {
else if (request.action == 'quickEnable') {
chrome.browserAction.setIcon({path: 'icon48.png'})
}
+ else if (request.action == 'trackMarkAsRead') {
+ _gaq.push(['_trackEvent', 'MarkAsRead', 'clicked']);
+ }
})
View
@@ -32,6 +32,7 @@ function add_read_buttons() {
var partner_id = 'fbid:' + RegExp.$1;
var read_url = 'https://m.facebook.com/messages/read/?tid=';
$(this).find('.mark_as_read').click(function() {
+ chrome.extension.sendRequest({action: 'trackMarkAsRead'})
var button = $(this)
button.addClass('inactive');
setTimeout(function() {
@@ -44,7 +45,7 @@ function add_read_buttons() {
}
$.ajax({
type: 'GET',
- url: read_url// + conversation_id
+ url: read_url + conversation_id
});
button.removeClass('inactive');
}, 2000);

0 comments on commit ce98854

Please sign in to comment.