added analytics for copied, unsupported, and restarted metrics

This commit is contained in:
Abhinav Adduri 2017-07-19 16:16:46 -07:00
parent 48da85b12b
commit 744dbb3a6f
6 changed files with 398 additions and 2387 deletions

View file

@ -7,6 +7,12 @@ const Raven = window.Raven;
$(document).ready(function() {
//link back to homepage
$('.send-new').attr('href', window.location.origin);
$('.send-new').click(function() {
window.analytics
.sendEvent('recipient', 'restarted', {
cd2: 'completed'
});
})
const filename = $('#dl-filename').html();

View file

@ -1,5 +1,13 @@
window.Raven = require('raven-js');
window.Raven.config(window.dsn).install();
window.dsn = undefined;
const testPilotGA = require('testpilot-ga');
window.analytics = new testPilotGA({
an: 'Firefox Send',
ds: 'web',
tid: window.trackerId
})
require('./upload');
require('./download');

View file

@ -6,12 +6,32 @@ require('jquery-circle-progress');
const Raven = window.Raven;
$(document).ready(function() {
gcmCompliant().catch(err => {
$('#page-one').attr('hidden', true);
$('#unsupported-browser').removeAttr('hidden');
gcmCompliant()
.catch(err => {
$('#page-one').attr('hidden', true);
$('#unsupported-browser').removeAttr('hidden');
window.analytics
.sendEvent('sender', 'unsupported', {
cd7: err
});
});
$('#file-upload').change(onUpload);
$('#send-new-completed').click(function() {
window.analytics
.sendEvent('sender', 'restarted', {
cd2: 'completed'
});
})
$('#send-new-error').click(function() {
window.analytics
.sendEvent('sender', 'restarted', {
cd2: 'errored'
});
})
$('body').on('dragover', allowDrop).on('drop', onUpload);
// reset copy button
const $copyBtn = $('#copy-btn');
@ -32,6 +52,10 @@ $(document).ready(function() {
// copy link to clipboard
$copyBtn.click(() => {
window.analytics
.sendEvent('sender', 'copied', {
cd6: 'success-screen'
});
const aux = document.createElement('input');
aux.setAttribute('value', $('#link').attr('value'));
document.body.appendChild(aux);
@ -251,6 +275,10 @@ $(document).ready(function() {
//copy link to clipboard when icon clicked
$copyIcon.click(function() {
window.analytics
.sendEvent('sender', 'copied', {
cd6: 'upload-list'
});
const aux = document.createElement('input');
aux.setAttribute('value', url);
document.body.appendChild(aux);