Vibe Google Analytics

This commit is contained in:
2026-06-25 18:55:04 -04:00
parent fdf8e754f5
commit 73ae3eac53
86 changed files with 53925 additions and 46039 deletions
@@ -0,0 +1,26 @@
using Microsoft.JSInterop;
namespace Shared.Services;
public class AnalyticsService
{
private readonly IJSRuntime _jsRuntime;
public AnalyticsService(IJSRuntime jsRuntime)
{
_jsRuntime = jsRuntime;
}
public async ValueTask TrackPageView(string path)
{
await _jsRuntime.InvokeVoidAsync("trackPageView", path);
}
public async ValueTask TrackEvent(string eventName, object? eventData = null)
{
if (eventData != null)
await _jsRuntime.InvokeVoidAsync("gtag", "event", eventName, eventData);
else
await _jsRuntime.InvokeVoidAsync("gtag", "event", eventName);
}
}