ScissorHands.Plugin.GoogleAnalytics 1.0.0-preview.20260915.1

This is a prerelease version of ScissorHands.Plugin.GoogleAnalytics.
dotnet add package ScissorHands.Plugin.GoogleAnalytics --version 1.0.0-preview.20260915.1
                    
NuGet\Install-Package ScissorHands.Plugin.GoogleAnalytics -Version 1.0.0-preview.20260915.1
                    
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="ScissorHands.Plugin.GoogleAnalytics" Version="1.0.0-preview.20260915.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ScissorHands.Plugin.GoogleAnalytics" Version="1.0.0-preview.20260915.1" />
                    
Directory.Packages.props
<PackageReference Include="ScissorHands.Plugin.GoogleAnalytics" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ScissorHands.Plugin.GoogleAnalytics --version 1.0.0-preview.20260915.1
                    
#r "nuget: ScissorHands.Plugin.GoogleAnalytics, 1.0.0-preview.20260915.1"
                    
#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.
#:package ScissorHands.Plugin.GoogleAnalytics@1.0.0-preview.20260915.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ScissorHands.Plugin.GoogleAnalytics&version=1.0.0-preview.20260915.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=ScissorHands.Plugin.GoogleAnalytics&version=1.0.0-preview.20260915.1&prerelease
                    
Install as a Cake Tool

ScissorHands.NET: Google Analytics Plugin

Adds Google Analytics tag markup to a compatible ScissorHands.NET site.

Getting Started

Install the preview package in your ScissorHands.NET host:

dotnet add package ScissorHands.Plugin.GoogleAnalytics --prerelease

Add this entry to the Plugins array in appsettings.json. Replace G-EXAMPLE with your Google Analytics measurement ID for real tracking:

{
  "Plugins": [
    {
      "Id": "google-analytics",
      "Options": { "MeasurementId": "G-EXAMPLE" }
    }
  ]
}

In a layout supplied with the engine's cascading context, place the component just after the opening <head> tag:

<GoogleAnalyticsComponent Id="google-analytics" />

Alternatively, use the paired placeholder for the post-HTML hook:

<plugin:google-analytics></plugin:google-analytics>

Choose one path per insertion to avoid duplicates. Hook placeholders must be paired, not self-closing. The Id is exact and case-sensitive; an optional manifest Name is only a display label.

The hook replaces every paired marker case-insensitively and leaves unmarked HTML unchanged when configuration is valid. It does not deduplicate existing tags. The component refreshes its configuration when cascading context or selection changes and renders nothing when its selected manifest is absent.

Configuration and breaking migration

An enabled manifest requires a string MeasurementId: G- followed by one or more uppercase ASCII letters or digits, without whitespace. G-EXAMPLE is a supported synthetic value; syntax validation does not verify a Google property.

Both paths throw InvalidOperationException for missing or invalid identifiers, including null/non-string values and whitespace-padded input. The error identifies the plugin and option without exposing the supplied value. The hook validates even when no paired marker is present.

Breaking change: earlier versions accepted arbitrary strings and emitted an empty ID for missing or non-string values. Before upgrading, supply a supported identifier or remove the google-analytics manifest. Clearing the value or setting an unrelated Enabled option does not disable this plugin.

Preview and privacy

Configured output is retained in preview and production. Generation performs no provider request, but browsing generated pages can contact Google even with the fake ID. The plugin does not manage consent, suppress preview tracking, or provide provider retention/deletion controls. Remove its entry from Plugins to disable output.

See the technical requirements and evidence for validation, output handling and verification details.

Support

See the shared support and recovery policy for best-effort issue support and preview-release recovery.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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.0-preview.20260915.1 76 9/15/2026