Skip to content
Sealmetrics

    ↑↓ to move · Enter to open · Esc to close

    Docs menu

    Implementation · Content & Site Structure

    Content Grouping

    Group pages into categories like blog, product, or checkout with Sealmetrics content grouping, set via a URL parameter or the JavaScript API.

    Content Grouping categorizes pages into logical groups for aggregated analysis. Instead of analyzing individual URLs, you can group related pages (e.g., all blog posts, all product pages) and view metrics for the entire group.

    What Content Grouping Does

    Without Content GroupingWith Content Grouping
    /blog/post-1 → 50 viewsBlog → 1,200 views
    /blog/post-2 → 30 viewsProducts → 3,500 views
    /blog/post-3 → 25 viewsCheckout → 800 views
    ... (hundreds of rows)(5-10 meaningful groups)

    Content grouping enables:

    • Conversions by content group
    • Bounce rate per section
    • Traffic distribution across page types
    • Funnel analysis by content type

    Two Ways to Set Up Content Grouping

    Add the group parameter to the tracker script. The group is set automatically for all pageviews on that page.

    html
    <!-- Blog pages -->
    <script src="https://t.sealmetrics.com/t.js?id=YOUR_ACCOUNT_ID&group=blog" defer></script>
    
    <!-- Product pages -->
    <script src="https://t.sealmetrics.com/t.js?id=YOUR_ACCOUNT_ID&group=product" defer></script>
    
    <!-- Checkout flow -->
    <script src="https://t.sealmetrics.com/t.js?id=YOUR_ACCOUNT_ID&group=checkout" defer></script>

    Method 2: JavaScript API

    Set the group dynamically when calling pageview:

    javascript
    sealmetrics({ group: 'blog' });

    This is useful when:

    • The group depends on page content (not URL structure)
    • You're using a SPA with dynamic sections
    • You want to override the URL parameter

    Setting Up Content Groups in Dashboard

    Step 1: Navigate to Settings

    1. Log in to Sealmetrics
    2. Select your site from the dropdown
    3. Click Settings in the sidebar
    4. Click Properties

    Step 2: Add Content Group Rules

    You have two options:

    1. Click Quick Setup
    2. Choose a template that matches your site structure:
    TemplateUse CaseExample Rules
    eCommerceOnline storesProducts, Categories, Cart, Checkout
    Blog / ContentPublishers, blogsBlog Posts, Categories, Authors
    SaaS / AppWeb applicationsDashboard, Settings, Billing
    DocumentationDocs sitesGetting Started, API Reference, Guides
    Support SiteHelp centersHelp Articles, Knowledge Base, Tickets
    Marketing SiteLanding pagesFeatures, Pricing, About, Case Studies
    1. Preview the rules
    2. Click Apply All Rules or add individual rules

    Option B: Manual Setup

    1. Click Add Rule
    2. Enter:
      • Group Name: The label shown in reports (e.g., "Blog Posts")
      • URL Pattern: The pattern to match (e.g., /blog/*)
    3. Click Add Rule

    URL Pattern Syntax

    Use * to match any characters:

    PatternMatchesDoes Not Match
    /blog/*/blog/my-post, /blog/2025/news/blogging, /blog
    /products/*/reviews/products/shoes/reviews/products/shoes
    /docs/*/docs/api, /docs/guides/intro/documentation
    // (homepage only)/about, /contact

    Step 3: Implement the Tracker

    After defining rules in the dashboard, you must also send the group from the tracker.

    Option A: Server-Side Rendering

    Set the group based on URL pattern on the server:

    php
    <?php
    $path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
    
    // Determine content group based on URL
    $group = 'other';
    if ($path === '/') {
        $group = 'homepage';
    } elseif (str_starts_with($path, '/blog/')) {
        $group = 'blog';
    } elseif (str_starts_with($path, '/products/')) {
        $group = 'product';
    } elseif (str_starts_with($path, '/checkout')) {
        $group = 'checkout';
    }
    ?>
    
    <script src="https://t.sealmetrics.com/t.js?id=YOUR_ACCOUNT_ID&group=<?= $group ?>" defer></script>

    Option B: Client-Side (SPA)

    Set the group when the route changes:

    javascript
    // React with react-router
    import { useLocation } from 'react-router-dom';
    import { useEffect } from 'react';
    
    function useContentGrouping() {
      const location = useLocation();
    
      useEffect(() => {
        let group = 'other';
    
        if (location.pathname === '/') {
          group = 'homepage';
        } else if (location.pathname.startsWith('/blog/')) {
          group = 'blog';
        } else if (location.pathname.startsWith('/products/')) {
          group = 'product';
        } else if (location.pathname.startsWith('/checkout')) {
          group = 'checkout';
        }
    
        if (typeof sealmetrics !== 'undefined') {
          sealmetrics({ group });
        }
      }, [location.pathname]);
    }

    Option C: CMS-Based

    For WordPress, WooCommerce, or other CMS:

    php
    <?php
    function get_content_group() {
        if (is_front_page()) return 'homepage';
        if (is_single() && get_post_type() === 'post') return 'blog';
        if (is_product()) return 'product';
        if (is_cart()) return 'cart';
        if (is_checkout()) return 'checkout';
        if (is_account_page()) return 'account';
        return 'other';
    }
    ?>
    
    <script src="https://t.sealmetrics.com/t.js?id=YOUR_ACCOUNT_ID&group=<?= get_content_group() ?>" defer></script>

    Viewing Content Group Reports

    Pages Report

    1. Go to Pages in the sidebar
    2. The Content Group column shows the assigned group for each page
    3. Use the Group by dropdown to aggregate by content group

    Filtering by Content Group

    1. Click Add Filter
    2. Select Content Group
    3. Choose one or more groups

    Common Content Group Structures

    eCommerce

    GroupPatternPages
    Homepage/Landing page
    Products/products/*Product listings, search results
    Product Details/product/*Individual product pages
    Cart/cartShopping cart
    Checkout/checkout/*Checkout steps
    Account/account/*User account, orders
    Blog/blog/*Content marketing

    SaaS

    GroupPatternPages
    Marketing/, /features/*, /pricingPublic pages
    App/app/*, /dashboard/*Authenticated app
    Settings/settings/*User settings
    Billing/billing/*Subscription management
    Docs/docs/*Documentation

    Publisher / Blog

    GroupPatternPages
    Homepage/Main page
    Articles/articles/*, /news/*Content pages
    Categories/category/*Topic pages
    Authors/author/*Author pages
    Archives/archive/*Historical content

    Best Practices

    Do

    • Keep groups meaningful: 5-15 groups is ideal
    • Use consistent naming: blog not Blog Posts or blog-posts
    • Group by user intent: Separate informational vs transactional content
    • Test patterns: Verify URLs match expected groups before going live

    Don't

    • Over-segment: 50+ groups makes analysis difficult
    • Use overlapping patterns: /products/* and /products/sale/* may conflict
    • Forget to implement: Dashboard rules require tracker implementation

    Troubleshooting

    Pages showing wrong content group

    1. Check the group parameter in the tracker script
    2. Verify URL pattern matches in Settings > Properties
    3. Confirm pattern priority (more specific patterns should have higher priority)

    Content group not appearing in reports

    1. Ensure the tracker includes the group parameter
    2. Confirm the hit arrived: the Last hit timestamp on the Overview report should move to "seconds ago" after your test visit
    3. Check that the page has received traffic since adding the group

    "Other" or empty content group

    Pages without a matching rule or group parameter will show as ungrouped. Either:

    • Add a rule to match the URL pattern
    • Add a catch-all rule with pattern /* and name "Other"