gitea umzug
This commit is contained in:
@@ -5,23 +5,25 @@ import { OpenPanel } from '@openpanel/web';
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AnalyticsService {
|
||||
private openpanel: OpenPanel;
|
||||
|
||||
constructor() {
|
||||
OpenPanel.init({
|
||||
clientId: 'DEINE_CLIENT_ID', // Aus dem OpenPanel Dashboard
|
||||
trackScreenViews: true, // Automatisches Tracking von Routenwechseln
|
||||
this.openpanel = new OpenPanel({
|
||||
clientId: 'DEINE_CLIENT_ID',
|
||||
trackScreenViews: true,
|
||||
trackOutgoingLinks: true,
|
||||
url: 'https://api.deine-coolify-domain.de' // WICHTIG: Deine eigene API URL!
|
||||
});
|
||||
}
|
||||
|
||||
// Methode für benutzerdefinierte Events (das "Brett")
|
||||
trackEvent(name: string, properties?: object) {
|
||||
openpanel.track(name, properties);
|
||||
trackEvent(name: string, properties?: Record<string, any>) {
|
||||
this.openpanel.track(name, properties);
|
||||
}
|
||||
|
||||
// Für deinen Kunden-Login: User identifizieren
|
||||
identifyUser(userId: string, traits?: object) {
|
||||
openpanel.identify(userId, traits);
|
||||
identifyUser(userId: string, traits?: Record<string, any>) {
|
||||
this.openpanel.identify(userId);
|
||||
|
||||
if (traits) {
|
||||
this.openpanel.setProfile(traits);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user