diff --git a/app/metrics.js b/app/metrics.js
index e469d12a..bc6783f2 100644
--- a/app/metrics.js
+++ b/app/metrics.js
@@ -20,7 +20,7 @@ let experiment = null;
export default function initialize(state, emitter) {
appState = state;
emitter.on('DOMContentLoaded', () => {
- // addExitHandlers();
+ addExitHandlers();
experiment = storage.enrolled[0];
sendEvent(category(), 'visit', {
cm5: storage.totalUploads,
@@ -29,9 +29,8 @@ export default function initialize(state, emitter) {
});
//TODO restart handlers... somewhere
});
- emitter.on('exit', evt => {
- exitEvent(evt);
- });
+ emitter.on('exit', exitEvent);
+ emitter.on('experiment', experimentEvent);
}
function category() {
@@ -259,6 +258,10 @@ function exitEvent(target) {
});
}
+function experimentEvent(params) {
+ return sendEvent(category(), 'experiment', params);
+}
+
// eslint-disable-next-line no-unused-vars
function addExitHandlers() {
const links = Array.from(document.querySelectorAll('a'));
diff --git a/app/templates/fxPromo.js b/app/templates/fxPromo.js
index 2252cd31..e4637a25 100644
--- a/app/templates/fxPromo.js
+++ b/app/templates/fxPromo.js
@@ -1,22 +1,9 @@
const html = require('choo/html');
const assets = require('../../common/assets');
-// function replaceLinks(str, urls) {
-// let i = -1;
-// const s = str.replace(/([^<]+)<\/a>/g, (m, v) => {
-// i++;
-// return `${v}`;
-// });
-// return [`${s}`];
-// }
-
module.exports = function(state, emit) {
- // function close() {
- // document.querySelector('.banner').remove();
- // }
-
- function clicked(evt) {
- emit('exit', evt);
+ function clicked() {
+ emit('experiment', { cd3: 'promo' });
}
const classes = state.promo === 'blue' ? 'banner banner-blue' : 'banner';
@@ -37,10 +24,3 @@ module.exports = function(state, emit) {
`;
};
-
-/*
-
-*/
diff --git a/app/templates/share.js b/app/templates/share.js
index 291f2ff9..c9c311ce 100644
--- a/app/templates/share.js
+++ b/app/templates/share.js
@@ -21,7 +21,7 @@ function passwordComplete(state, password) {
+ value="${state.translate('changePasswordButton')}"/>
`
]);