Skip to content

Commit

Permalink
Analytics tracker view and button clicked added
Browse files Browse the repository at this point in the history
  • Loading branch information
mlazzje committed Dec 20, 2015
1 parent 1ce88ab commit 03cf9a7
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 3 deletions.
6 changes: 6 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ Promise.all([
InboxSDK.load('1.0', 'sdk_mlazzje-dlgmail_43a7d41655')
])
.then(function(results){
var service = analytics.getService('better_download_all_attachments_app');
var tracker = service.getTracker('UA-67984409-1');
var sdk = results[0];

var registerHandler = function() {
Expand All @@ -12,6 +14,8 @@ Promise.all([
if(messageView.isLoaded()) {
// Add CustomAttachmentsToolbarButton to the given message view.
addCustomAttachmentsToolbarButton(messageView);
// Send to Analytics that the Button has been loaded
tracker.sendAppView('ButtonView');
}
};

Expand All @@ -28,6 +32,8 @@ Promise.all([
var handleAttachmentsButtonClick = function(event) {
var downloadUrls = [];

// Send to Analytics that the Button has been clicked
tracker.sendEvent('Button', 'DownloadAllAttachments', 'Init');
// Iterate over attachmentCardViews array to get URL's.
event.attachmentCardViews.forEach(function(attachmentCardView, index) {

Expand Down
Loading

0 comments on commit 03cf9a7

Please sign in to comment.