From 7bf32176a7534a82ee47f46eb9347a4fbb3af362 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 26 Sep 2023 09:14:53 +0100 Subject: [PATCH] Add event for block ejection --- packages/builder/src/analytics/constants.js | 1 + packages/builder/src/builderStore/store/frontend.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/packages/builder/src/analytics/constants.js b/packages/builder/src/analytics/constants.js index 1bb8517a2b..5264e16abc 100644 --- a/packages/builder/src/analytics/constants.js +++ b/packages/builder/src/analytics/constants.js @@ -2,6 +2,7 @@ export const Events = { COMPONENT_CREATED: "component:created", COMPONENT_UPDATED: "component:updated", APP_VIEW_PUBLISHED: "app:view_published", + BLOCK_EJECTED: "block:ejected", } export const EventSource = { diff --git a/packages/builder/src/builderStore/store/frontend.js b/packages/builder/src/builderStore/store/frontend.js index 13b28a3572..6c029ddff3 100644 --- a/packages/builder/src/builderStore/store/frontend.js +++ b/packages/builder/src/builderStore/store/frontend.js @@ -1287,6 +1287,11 @@ export const getFrontendStore = () => { return false } + // Log event + analytics.captureEvent(Events.BLOCK_EJECTED, { + block: block._component, + }) + // Attach block children back into ejected definition, using the // _containsSlot flag to know where to insert them const slotContainer = findAllMatchingComponents(