Skip to content

Analytics

Alex de Borba edited this page Jun 21, 2026 · 1 revision

Analytics

Aegis includes a privacy-first analytics framework that supports multiple analytics providers. The system is designed to respect visitor privacy while giving site owners the insights they need.

Supported Providers

Provider Type Privacy Level Availability
Google Analytics 4 (GA4) Full analytics Standard Theme
Google Tag Manager (GTM) Tag management Depends on tags Theme
Microsoft Clarity Behavior analytics Standard Theme
Plausible Privacy-focused High Theme
Fathom Privacy-focused High Theme
Matomo Self-hosted analytics High (self-hosted) Theme
Meta Pixel Advertising Standard Pro only

Privacy-First Approach

The Aegis analytics framework follows these principles:

  1. No tracking by default — Analytics are disabled until explicitly configured.
  2. Consent awareness — Integration with consent management for GDPR/CCPA compliance.
  3. Minimal data collection — Only necessary data points are tracked.
  4. No third-party cookies (where possible) — Privacy-focused providers do not use cookies.
  5. Conditional loading — Analytics scripts load only when consent is given (if consent mode is enabled).

Configuration

Analytics settings are configured through the WordPress admin:

  1. Navigate to Appearance → Editor → Styles or the theme settings panel.
  2. Locate the analytics configuration section.
  3. Enter your tracking ID or measurement ID for the desired provider.
  4. Configure consent and loading options.
  5. Save your settings.

Provider Configuration

Google Analytics 4

Setting Description
Measurement ID Your GA4 measurement ID (G-XXXXXXXXXX).
Consent mode Enable Google Consent Mode v2 integration.
Anonymize IP Strip the last octet of visitor IP addresses.

Google Tag Manager

Setting Description
Container ID Your GTM container ID (GTM-XXXXXXX).
Data layer Custom data layer events pushed by the theme.

Microsoft Clarity

Setting Description
Project ID Your Clarity project identifier.

Plausible

Setting Description
Domain Your site domain registered in Plausible.
Self-hosted URL Custom domain if self-hosting Plausible.

Fathom

Setting Description
Site ID Your Fathom site identifier.
Custom domain Your custom Fathom tracking domain (optional).

Matomo

Setting Description
URL Your Matomo instance URL.
Site ID Your site ID within Matomo.

Meta Pixel (Pro Only)

Setting Description
Pixel ID Your Meta (Facebook) pixel identifier.
Events Configurable conversion events.

Note: Meta Pixel integration is available only in Aegis Pro.

Consent Integration

For sites requiring cookie consent (GDPR, CCPA, and similar regulations):

How It Works

  1. Analytics scripts are not loaded on initial page load.
  2. The theme checks for consent status via a standardized consent API.
  3. When consent is granted, analytics scripts are dynamically loaded.
  4. When consent is denied or withdrawn, no tracking occurs.

Google Consent Mode v2

When Google Analytics or GTM is configured with consent mode:

  • Default consent state is set to "denied" for analytics and advertising.
  • When the visitor grants consent, the state updates to "granted."
  • GA4 operates in cookieless mode when consent is denied (behavioral modeling only).

Compatible Consent Plugins

The consent system works with standard consent management plugins that set consent cookies or use the WordPress consent API.

Performance

Analytics scripts are loaded with performance in mind:

  • Scripts use async or defer attributes to avoid blocking page rendering.
  • Scripts load after the main content is rendered.
  • Privacy-focused providers (Plausible, Fathom) use lightweight scripts (under 1 KB).
  • No analytics scripts load if no provider is configured.

See performance for the overall theme performance strategy.

WooCommerce Events

When WooCommerce is active, the analytics framework can track e-commerce events:

Event Trigger
view_item Product page viewed
add_to_cart Item added to cart
begin_checkout Checkout started
purchase Order completed
view_item_list Product list viewed

These events are pushed to GA4 and GTM automatically when configured.

Excluding Logged-In Users

By default, analytics can be configured to exclude tracking for logged-in administrators and editors, ensuring internal traffic does not skew data.

Multiple Providers

You can enable multiple analytics providers simultaneously. For example:

  • Plausible for privacy-friendly visitor stats.
  • Google Tag Manager for marketing and advertising tags.
  • Clarity for session recordings and heatmaps.

Each provider loads independently and does not conflict with others.

Verifying Analytics

After configuration, verify that analytics are working:

  1. Open your site in an incognito/private browser window.
  2. Open browser developer tools (F12) and switch to the Network tab.
  3. Look for requests to your analytics provider domain.
  4. Check the real-time reports in your analytics dashboard.

Next Steps

Clone this wiki locally