Skip to content

Latest commit

 

History

History
49 lines (34 loc) · 1.11 KB

README.md

File metadata and controls

49 lines (34 loc) · 1.11 KB

Blazor extensions for Analytics: Google Analytics, GTAG, ...
AspNetCore Version: 3.0.0

NuGet Package

https://nuget.org/packages/Blazor-Analytics

Configuration

Google Analytics, GTAG

First, import the component in _Imports.razor

@using Blazor.Analytics.GoogleAnalytics.Components

Then, add the GoogleAnalytics component below your Router in App.razor.
The tracker listens to every navigation change while it's rendered on a page.

    <Router ... />
+   <GoogleAnalytics TrackingId="UA-XXXXXXXXX-X" />

ServerSide Specific Configuration

Edit _Host.cshtml and apply the following change:

    <script src="_framework/blazor.server.js"></script>
+   <script src="_content/Blazor-Analytics/blazor-analytics.js"></script>

WASM Specific Configuration

Edit index.html and apply the following change:

    <script src="_framework/blazor.webassembly.js"></script>
+   <script src="_content/Blazor-Analytics/blazor-analytics.js"></script>

Changelog

v3.0.0

  • Added support for
    • ServerSide (pre-rendering)
    • ServerSide (runtime)
    • WASM (runtime)