Add event for block ejection

This commit is contained in:
Andrew Kingston 2023-09-26 09:14:53 +01:00
parent 3ab119ebf0
commit 7bf32176a7
2 changed files with 6 additions and 0 deletions

View File

@ -2,6 +2,7 @@ export const Events = {
COMPONENT_CREATED: "component:created", COMPONENT_CREATED: "component:created",
COMPONENT_UPDATED: "component:updated", COMPONENT_UPDATED: "component:updated",
APP_VIEW_PUBLISHED: "app:view_published", APP_VIEW_PUBLISHED: "app:view_published",
BLOCK_EJECTED: "block:ejected",
} }
export const EventSource = { export const EventSource = {

View File

@ -1287,6 +1287,11 @@ export const getFrontendStore = () => {
return false return false
} }
// Log event
analytics.captureEvent(Events.BLOCK_EJECTED, {
block: block._component,
})
// Attach block children back into ejected definition, using the // Attach block children back into ejected definition, using the
// _containsSlot flag to know where to insert them // _containsSlot flag to know where to insert them
const slotContainer = findAllMatchingComponents( const slotContainer = findAllMatchingComponents(