BlazorAnalytics 1.0.0
See the version list below for details.
dotnet add package BlazorAnalytics --version 1.0.0
NuGet\Install-Package BlazorAnalytics -Version 1.0.0
<PackageReference Include="BlazorAnalytics" Version="1.0.0" />
paket add BlazorAnalytics --version 1.0.0
#r "nuget: BlazorAnalytics, 1.0.0"
// Install BlazorAnalytics as a Cake Addin #addin nuget:?package=BlazorAnalytics&version=1.0.0 // Install BlazorAnalytics as a Cake Tool #tool nuget:?package=BlazorAnalytics&version=1.0.0
Blazor extensions for Analytics. Supported platforms: Google Analytics, Google Tag Manager, and FaceBook Pixel.
What is Blazor Analytics and what can it do for me?
First Credit where Credit is Due
All the hard work was done by welisonmenezes in his blazor-universal-analytics repository.
Configuration
For Every Tracker
First, Install Nuget, then import the namespaces in _Imports.razor
@using BlazorAnalytics
Then, add the AnalyticsNavigationTracker
component below your Router in App.razor
.<br/>
The tracker listens to every navigation change while it's rendered on a page.
<Router ... />
+ <AnalyticsNavigationTracker />
Setting up Analytics
Inside your main Startup
/Program
, call AddBUA
. This will configure your GTAG_ID automatically.
+ builder.Services.AddBlazorAnalytics("YOUR_GTAG_ID", "YOUR_FBPIXEL_ID", null);
If YOUR_GTM_ID is set, YOUR_GTAG_ID and YOUR_FBPIXEL_ID will be ignored as GTM will manage this for you. Pageview events will be heard if the embed of such scripts exists. Example:
builder.Services.AddBlazorAnalytics(null, null, null);
How to trigger an Analytics Event
Blazor Analytics
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- Microsoft.AspNetCore.Components.Web (>= 8.0.2)
- Microsoft.AspNetCore.Components.WebAssembly (>= 8.0.2)
- Microsoft.AspNetCore.WebUtilities (>= 8.0.2)
- Microsoft.Extensions.Http (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.