فهرست منبع

Merge pull request #5382 from overleaf/tm-analytics-project-create-segmentation

Fix for project-created event segmentation data

GitOrigin-RevId: 5b8eb14a4ea03e7136c529742a183291557d2715
Thomas 4 سال پیش
والد
کامیت
85adea3f50
1فایلهای تغییر یافته به همراه15 افزوده شده و 8 حذف شده
  1. 15 8
      services/web/app/src/Features/Project/ProjectCreationHandler.js

+ 15 - 8
services/web/app/src/Features/Project/ProjectCreationHandler.js

@@ -34,16 +34,23 @@ const MONTH_NAMES = [
 async function createBlankProject(ownerId, projectName, attributes = {}) {
 async function createBlankProject(ownerId, projectName, attributes = {}) {
   const isImport = attributes && attributes.overleaf
   const isImport = attributes && attributes.overleaf
   const project = await _createBlankProject(ownerId, projectName, attributes)
   const project = await _createBlankProject(ownerId, projectName, attributes)
+  const segmentation = _.pick(attributes, [
+    'fromV1TemplateId',
+    'fromV1TemplateVersionId',
+  ])
+  segmentation.projectId = project._id
   if (isImport) {
   if (isImport) {
-    AnalyticsManager.recordEventForUser(ownerId, 'project-imported', {
-      projectId: project._id,
-      attributes,
-    })
+    AnalyticsManager.recordEventForUser(
+      ownerId,
+      'project-imported',
+      segmentation
+    )
   } else {
   } else {
-    AnalyticsManager.recordEventForUser(ownerId, 'project-created', {
-      projectId: project._id,
-      attributes,
-    })
+    AnalyticsManager.recordEventForUser(
+      ownerId,
+      'project-created',
+      segmentation
+    )
   }
   }
   return project
   return project
 }
 }