forked from PostHog/posthog
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: wire cross sells into product intent logic (PostHog#27767)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
c0d674f
commit 63afbcc
Showing
14 changed files
with
108 additions
and
48 deletions.
There are no files selected for viewing
Binary file modified
BIN
-72 Bytes
(100%)
frontend/__snapshots__/replay-player-success--second-recording-in-list--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2 Bytes
(100%)
...snapshots__/scenes-app-insights--funnel-top-to-bottom-breakdown-edit--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import api from 'lib/api' | ||
|
||
import type { ProductKey, TeamType } from '~/types' | ||
|
||
export enum ProductIntentContext { | ||
// Onboarding | ||
ONBOARDING_PRODUCT_SELECTED_PRIMARY = 'onboarding product selected - primary', | ||
ONBOARDING_PRODUCT_SELECTED_SECONDARY = 'onboarding product selected - secondary', | ||
|
||
// Data Warehouse | ||
SELECTED_CONNECTOR = 'selected connector', | ||
|
||
// Experiments | ||
EXPERIMENT_CREATED = 'experiment created', | ||
|
||
// Feature Flags | ||
FEATURE_FLAG_CREATED = 'feature flag created', | ||
|
||
// Cross Sells | ||
TAXONOMIC_FILTER_EMPTY_STATE = 'taxonomic filter empty state', | ||
WEB_ANALYTICS_INSIGHT = 'web_analytics_insight', | ||
} | ||
|
||
export type ProductIntentMetadata = Record<string, unknown> | ||
|
||
export type ProductIntentProperties = { | ||
product_type: ProductKey | ||
intent_context: ProductIntentContext | ||
metadata?: ProductIntentMetadata | ||
} | ||
|
||
export function addProductIntent(properties: ProductIntentProperties): Promise<TeamType | null> { | ||
return api.productIntents.update(properties) | ||
} | ||
|
||
export type ProductCrossSellProperties = { | ||
from: ProductKey | ||
to: ProductKey | ||
intent_context: ProductIntentContext | ||
metadata?: ProductIntentMetadata | ||
} | ||
|
||
export function addProductIntentForCrossSell(properties: ProductCrossSellProperties): Promise<TeamType | null> { | ||
return api.productIntents.update({ | ||
product_type: properties.to, | ||
intent_context: properties.intent_context, | ||
metadata: { | ||
...properties.metadata, | ||
from: properties.from, | ||
to: properties.to, | ||
type: 'cross_sell', | ||
}, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters