Added analytics event for WikiTree

This commit is contained in:
Przemek Wiech
2020-01-19 23:56:30 +01:00
parent 21451e4282
commit f454ca514b

View File

@@ -270,10 +270,14 @@ export class App extends React.Component<RouteComponentProps, {}> {
: await loadFromUrl(url!, handleCors); : await loadFromUrl(url!, handleCors);
const software = getSoftware(data.gedcom.head); const software = getSoftware(data.gedcom.head);
if (source == 'wikitree') {
analyticsEvent('wikitree_loaded');
} else {
analyticsEvent(hash ? 'upload_file_loaded' : 'url_file_loaded', { analyticsEvent(hash ? 'upload_file_loaded' : 'url_file_loaded', {
event_label: software, event_label: software,
event_value: (images && images.size) || 0, event_value: (images && images.size) || 0,
}); });
}
// Set state with data. // Set state with data.
this.setState( this.setState(