App copy
This commit is contained in:
@@ -5,6 +5,8 @@ type AnalyticsProperties = Record<string, unknown>;
|
||||
type SafeAnalytics = {
|
||||
capture: (event: string, properties?: AnalyticsProperties) => void;
|
||||
identify: (userId: string, properties?: AnalyticsProperties) => void;
|
||||
/** Setzt Person-Properties ohne die User-ID zu aendern (z. B. Experiment-Varianten). */
|
||||
identifyProperties: (properties: AnalyticsProperties) => void;
|
||||
screen: (name: string, properties?: AnalyticsProperties) => void;
|
||||
reset: () => void;
|
||||
};
|
||||
@@ -46,6 +48,15 @@ const safeAnalytics: SafeAnalytics = {
|
||||
console.warn('[Analytics] identify failed', error);
|
||||
}
|
||||
},
|
||||
identifyProperties: (properties) => {
|
||||
try {
|
||||
// PostHog RN: register() haengt die Properties an alle folgenden Events an,
|
||||
// damit laesst sich der komplette Funnel nach Variante segmentieren.
|
||||
client?.register(properties as Record<string, string>);
|
||||
} catch (error) {
|
||||
console.warn('[Analytics] identifyProperties failed', error);
|
||||
}
|
||||
},
|
||||
screen: (name, properties) => {
|
||||
try {
|
||||
client?.screen(name, properties as Record<string, string>);
|
||||
|
||||
Reference in New Issue
Block a user