Track how many projects are loaded, packaged, previewed
Planning for this to be temporary
This commit is contained in:
3 files changed
+14
-3
No files matched your search
@@ -8,6 +8,7 @@
|
||||
import Preview from './preview';
|
||||
import deepClone from './lib/deep-clone';
|
||||
import assetCache from './cache';
|
||||
import analytics from './analytics';
|
||||
|
||||
export let projectData;
|
||||
|
||||
@@ -98,6 +99,7 @@
|
||||
if (result) {
|
||||
downloadURL(result.filename, url);
|
||||
}
|
||||
analytics.sendEvent('Package');
|
||||
};
|
||||
|
||||
const preview = async () => {
|
||||
@@ -111,6 +113,7 @@
|
||||
previewer.close();
|
||||
}
|
||||
previewer = null;
|
||||
analytics.sendEvent('Preview');
|
||||
};
|
||||
|
||||
const reset = async () => {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
import {UserError} from './errors';
|
||||
import loadProject from './load-project';
|
||||
import getProjectTitle from './lib/get-project-meta.js';
|
||||
import analytics from './analytics';
|
||||
|
||||
export let projectData = null;
|
||||
const type = writablePersistentStore('SelectProject.type', 'id');
|
||||
@@ -81,6 +82,8 @@
|
||||
title: projectTitle,
|
||||
project,
|
||||
};
|
||||
|
||||
analytics.sendEvent('Load Project');
|
||||
} catch (e) {
|
||||
$error = e;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,9 @@ const enabled =
|
||||
navigator.doNotTrack !== '1';
|
||||
|
||||
const sendEvent = eventName => {
|
||||
if (!enabled) {
|
||||
return;
|
||||
}
|
||||
setTimeout(() => {
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open('POST', PLAUSIBLE_API, true);
|
||||
@@ -21,6 +24,8 @@ const sendEvent = eventName => {
|
||||
});
|
||||
};
|
||||
|
||||
if (enabled) {
|
||||
sendEvent('pageview');
|
||||
}
|
||||
sendEvent('pageview');
|
||||
|
||||
export default {
|
||||
sendEvent
|
||||
};
|
||||
Reference in new issue
Block a user