BlazorAnalytics 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package BlazorAnalytics --version 1.0.0                
NuGet\Install-Package BlazorAnalytics -Version 1.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BlazorAnalytics" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BlazorAnalytics --version 1.0.0                
#r "nuget: BlazorAnalytics, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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

Build Status GitHub Issues GitHub Stars

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.2 457 2/17/2024
1.0.1 88 2/17/2024
1.0.0 77 2/17/2024