Send UUID while the admin is loaded

This commit is contained in:
Aurélien Georget 2019-11-22 18:37:54 +01:00
parent e981177fd1
commit 38f70a6e59

View File

@ -43,6 +43,20 @@ function App(props) {
const { hasAdmin } = await request(requestURL, { method: 'GET' });
const { data } = await request('/admin/init', { method: 'GET' });
const { uuid } = data;
if (uuid) {
await fetch('https://analytics.strapi.io/track', {
method: 'POST',
body: JSON.stringify({
event: 'didInitializeAdministration',
uuid,
}),
headers: {
'Content-Type': 'application/json',
},
});
}
getDataRef.current(hasAdmin, data);
setState({ hasAdmin, isLoading: false });