@@ -462,19 +462,30 @@
url: @js($shareUrl),
title: @js($release->title),
copied: false,
- copy() { navigator.clipboard?.writeText(this.url).then(() => { this.copied = true; setTimeout(() => this.copied = false, 2000); }); }
+ {{-- Share-Klicks als Ereignis loggen (ohne Personenbezug); in der Vorschau kein Tracking. --}}
+ trackUrl: @js($isPreview ? null : route('release.share', ['slug' => $release->slug])),
+ track(channel) {
+ if (!this.trackUrl) return;
+ fetch(this.trackUrl, {
+ method: 'POST',
+ keepalive: true,
+ headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': document.querySelector('meta[name=csrf-token]')?.content ?? '' },
+ body: JSON.stringify({ channel })
+ }).catch(() => {});
+ },
+ copy() { navigator.clipboard?.writeText(this.url).then(() => { this.copied = true; this.track('copy'); setTimeout(() => this.copied = false, 2000); }); }
}">
{{ __('web.detail.share') }}