feat: Add events to enable onboarding checklist (#5536)

* feat: Add new event hooks

* fix: update event

* feat: Add more functionality for webhooks

*  Not sending onboarding checklist event from templates page

* 🔥 Removing quotes added by mistake

*  Added rest of events needed for onboarding checklist

* 💄 Hiding appcues checklist inside iframes

* 💄 Updating appcues selector

* fix: remove unnessary fix

* fix: fix schedule node

* refactor: bake events into segment store

* refactor: rename store

* refactor: use node keys

* refactor: remove unnessary

* chore: clean up store

* refactor: add key for event

* fix: allow tracking on template pages

* chore: remove comment

* fix: buidl

* refactor: block event if in iframe

* fix: fix tracking nodes

* refactor: track experiments once

* fix: ensure tracking works

* chore: remove comment

* fix: lint

* fix: lint

---------

Co-authored-by: Milorad Filipovic <milorad@n8n.io>
This commit is contained in:
Mutasem Aldmour
2023-02-28 13:44:37 +03:00
committed by GitHub
parent ae634407a4
commit 20c4919513
9 changed files with 192 additions and 54 deletions

View File

@@ -268,6 +268,7 @@ import { nodeViewEventBus } from '@/event-bus/node-view-event-bus';
import { useWorkflowsStore } from '@/stores/workflows';
import { useRootStore } from '@/stores/n8nRootStore';
import { useNDVStore } from '@/stores/ndv';
import { useSegment } from '@/stores/segment';
import { useTemplatesStore } from '@/stores/templates';
import { useNodeTypesStore } from '@/stores/nodeTypes';
import { useCredentialsStore } from '@/stores/credentials';
@@ -304,7 +305,7 @@ import {
N8nPlusEndpointType,
EVENT_PLUS_ENDPOINT_CLICK,
} from '@/plugins/endpoints/N8nPlusEndpointType';
import { usePostHogStore } from '@/stores/posthog';
import { usePostHog } from '@/stores/posthog';
interface AddNodeOptions {
position?: XYPosition;
@@ -1925,6 +1926,7 @@ export default mixins(
});
} else {
this.$externalHooks().run('nodeView.addNodeButton', { nodeTypeName });
useSegment().trackAddedTrigger(nodeTypeName);
const trackProperties: ITelemetryTrackProperties = {
node_type: nodeTypeName,
is_auto_add: isAutoAdd,
@@ -2498,9 +2500,7 @@ export default mixins(
},
async tryToAddWelcomeSticky(): Promise<void> {
const newWorkflow = this.workflowData;
if (
usePostHogStore().isVariantEnabled(ASSUMPTION_EXPERIMENT.name, ASSUMPTION_EXPERIMENT.video)
) {
if (usePostHog().isVariantEnabled(ASSUMPTION_EXPERIMENT.name, ASSUMPTION_EXPERIMENT.video)) {
// For novice users (onboardingFlowEnabled == true)
// Inject welcome sticky note and zoom to fit