Tenant-Wide Telemetry Application Customizer
Sample Description
I would like to build a new SPFx sample that demonstrates how to build a tenant-wide Application Customizer designed to provide centralized telemetry for a SharePoint Online tenant.
What the sample should demonstrate
-
Application Customizer (React) that runs on every modern page
- Deployable tenant-wide via the App Catalog and the Tenant Wide Extensions list.
- Uses
skipFeatureDeployment: true so no per-site installation is needed.
- Automatically loads on every modern site/page within the tenant (based on extension registration).
-
Telemetry Initialization Logic
-
Listening for Custom Events
-
The customizer listens for browser CustomEvents (e.g., spfx-telemetry) dispatched by SPFx components.
-
This allows other web parts/extensions to send data without embedding their own telemetry logic.
-
The sample should show how the Application Customizer listens with:
window.addEventListener("spfx-telemetry", (e: CustomEvent) => {
// handle telemetry payload
});
-
Telemetry Payload Enrichment
-
Sending Telemetry to Backend
-
Tenant-Wide Deployment
-
Demonstrates:
- Using
skipFeatureDeployment: true
- How to register the Application Customizer in the Tenant Wide Extensions list
- How to configure component properties (e.g., App Insights connection string JSON)
Why this sample is useful
Many enterprises deploy dozens of SPFx solutions across thousands of sites.
There is no out-of-the-box tenant-wide analytics mechanism for customizations.
This sample will show how to:
- Deploy one Application Customizer solution globally
- Initialize telemetry one time per page
- Allow any SPFx web part or extension to send telemetry via simple
CustomEvents
- Centralize all event capture & enrichment
This pattern improves governance, modernization, and observability for large tenants.
Technology Stack
- SPFx Application Customizer (React)
- TypeScript telemetry service
- Application Insights (optional)
- HTTP telemetry endpoint (optional)
- Tenant Wide Extensions deployment
Expected Output
SPFx version
1.21.1
Are you willing to help?
Yes
Tenant-Wide Telemetry Application Customizer
Sample Description
I would like to build a new SPFx sample that demonstrates how to build a tenant-wide Application Customizer designed to provide centralized telemetry for a SharePoint Online tenant.
What the sample should demonstrate
Application Customizer (React) that runs on every modern page
skipFeatureDeployment: trueso no per-site installation is needed.Telemetry Initialization Logic
Initializes a telemetry provider at page load:
Supports loading configuration from:
ClientSideComponentPropertiesListening for Custom Events
The customizer listens for browser
CustomEvents (e.g.,spfx-telemetry) dispatched by SPFx components.This allows other web parts/extensions to send data without embedding their own telemetry logic.
The sample should show how the Application Customizer listens with:
Telemetry Payload Enrichment
The Application Customizer enriches telemetry with contextual data:
Ensures all telemetry is consistent across all SPFx components.
Sending Telemetry to Backend
The sample should show two possible patterns:
Telemetry errors must never break page rendering.
Tenant-Wide Deployment
Demonstrates:
skipFeatureDeployment: trueWhy this sample is useful
Many enterprises deploy dozens of SPFx solutions across thousands of sites.
There is no out-of-the-box tenant-wide analytics mechanism for customizations.
This sample will show how to:
CustomEventsThis pattern improves governance, modernization, and observability for large tenants.
Technology Stack
Expected Output
One SPFx solution containing only the Application Customizer
Telemetry service included within the solution
Documentation for:
SPFx version
1.21.1
Are you willing to help?
Yes