Umbraco Analytics Integrations: Setup Guide | OpsBlu Docs

Umbraco Analytics Integrations: Setup Guide

Integrate analytics tools with Umbraco CMS using Razor views, packages, and .NET middleware. Covers GA4, GTM, Meta Pixel, and Umbraco Commerce...

Set up analytics and tracking tools on your Umbraco website to measure performance and user engagement.

Available Integrations

Google Analytics

Track visitor behavior and conversions with GA4.

Google Tag Manager

Centralize all your tracking tags with GTM for easier management.

Meta Pixel

Track Facebook and Instagram ad conversions.

Integration Approach

Umbraco integrations are typically implemented via:

  1. Layout templates - Add tracking code to master layouts
  2. Partial views - Include tracking in reusable components
  3. Packages - Install from Umbraco Marketplace
  4. JavaScript bundles - Include in your build process

For most Umbraco sites:

  1. Add GTM container to your master layout
  2. Create data layer in partial views for dynamic content
  3. Configure GA4 through GTM
  4. Add advertising pixels through GTM

Data Layer Implementation

Example Razor data layer:

<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
    'pageType': '@Model.ContentType.Alias',
    'pageTitle': '@Model.Name',
    'language': '@Model.GetCultureFromDomains()'
});
</script>

Package Options

Popular Umbraco analytics packages:

Considerations

  • Caching: Ensure tracking works with output caching
  • SPA/Headless: Adjust tracking for headless implementations
  • Multilingual: Configure tracking per language/culture