---
title: "Drupal"
description: "Install the Sealmetrics Drupal module (9, 10, and 11) via Composer or manually for cookieless analytics with form, search, and 404 error tracking."
canonical_url: "https://docs.sealmetrics.com/integrations/cms/drupal"
lang: "en"
date_generated: "2026-10-08T17:47:47.862Z"
source_hash: "896e25a9992d7d631f59ad1490ba2fb6f37f67899b84b88fba4bc30ed758c077"
content_type: "implementation"
owner: "engineering"
llm_priority: "critical"
source_file: "integrations/cms/drupal.mdx"
publisher: "Sealmetrics"
---

# Drupal

Canonical page: https://docs.sealmetrics.com/integrations/cms/drupal

Privacy-first, cookieless analytics for Drupal 9, 10, and 11.

## Requirements

- Drupal 9.x, 10.x, or 11.x

## Installation

### Option 1: Manual Installation

1. Download and extract the module
2. Copy to `modules/contrib/sealmetrics` or `modules/custom/sealmetrics`
3. Go to **Extend** (`/admin/modules`)
4. Enable "Sealmetrics Analytics"
5. Configure at **Configuration > System > Sealmetrics Analytics**

### Option 2: Composer

```bash
composer require drupal/sealmetrics
drush en sealmetrics
```

## Configuration

1. Go to `/admin/config/system/sealmetrics`
2. Enter your **Account ID** — this is your Site ID, shown in **Settings → Sites → [your site] → General** ([how to find it](/platform/account-setup/find-account-id))
3. Configure tracking options:

| Setting | Description |
|---------|-------------|
| **Account ID** | Your Sealmetrics Account ID (required) |
| **Skip admin pages** | Don't track admin page views |
| **Track form submissions** | Track contact forms, webforms |
| **Track contact forms as leads** | Track as conversions instead of events |
| **Track search queries** | Track site searches |
| **Track 404 errors** | Track broken link visits |

## Tracked Events

### Automatic Events

| Event | Description |
|-------|-------------|
| `pageview` | All page views with content grouping |
| `form_submit` | Form submissions (unless newsletter) |
| `newsletter_signup` | Newsletter form submissions |
| `lead` | Contact forms (if configured as lead) |
| `search` | Site search queries |
| `404_error` | Page not found errors |

### Content Groups

The module automatically detects content types:

| Content Type | Group |
|--------------|-------|
| Front page | `home` |
| Article/Blog | `blog` |
| Page | `page` |
| Product | `product` |
| Taxonomy term | `category` |
| User pages | `account` |
| Search | `search` |
| 404 | `404` |

Custom content types use their machine name as the group.

## Form Detection

The module intelligently distinguishes between:

### Newsletter Forms

Tracked as `newsletter_signup` microconversion:
- Form ID/class contains: `newsletter`, `subscribe`, `mailchimp`, etc.
- Forms with only an email field

### Contact Forms

Tracked as `form_submit` or `lead` conversion:
- All other forms (contact, quote requests, etc.)

## Webform Integration

Full support for the Webform module:
- Standard form submissions
- AJAX form submissions
- Multi-step forms (tracked on final submission)

## Custom Event Tracking

Track custom events in your theme or module:

```javascript
// Wait for Sealmetrics to load
(function() {
  function track() {
    if (typeof sealmetrics !== 'undefined') {
      sealmetrics.micro('custom_event', {
        property: 'value'
      });
    } else {
      setTimeout(track, 100);
    }
  }
  track();
})();
```

## Conversions

Track conversions (purchases, leads, signups):

```javascript
// Lead conversion
sealmetrics.conv('lead', 0, {
  source: 'quote_form'
});

// Purchase (if using Commerce)
sealmetrics.conv('purchase', 99.99, {
  currency: 'EUR'
});
```

## Drupal Commerce Integration

For e-commerce tracking with Drupal Commerce, add this to your order complete template or hook:

```php
// In hook_commerce_order_place() or similar
function mymodule_track_purchase($order) {
  $total = $order->getTotalPrice()->getNumber();
  $currency = $order->getTotalPrice()->getCurrencyCode();

  // Add inline script
  $script = "
    if (typeof sealmetrics !== 'undefined') {
      sealmetrics.conv('purchase', {$total}, {
        currency: '{$currency}'
      });
    }
  ";
  // Attach to page via #attached
}
```

## Privacy

- No cookies used
- No data that identifies anyone stored; reports are aggregated
- No order IDs or user IDs stored
- Designed for GDPR and ePrivacy (self-assessed, see [Compliance](/compliance))
- No consent banner for Sealmetrics' own analytics (self-assessed; Germany: open question — see [Germany](/compliance/germany-ttdsg-self-assessment))

## Related documentation

- [Installation](/implementation/tracker/installation) — how the underlying Sealmetrics tracker loads.
- [Understanding Event Properties in Sealmetrics](/implementation/custom-properties/event-properties) — the model behind the form, search, and 404 events this module fires.
- [WordPress](/integrations/cms/wordpress) — the equivalent integration for WordPress sites.
- [Joomla](/integrations/cms/joomla) — the equivalent integration for Joomla sites.
- [Integrations Overview](/integrations) — browse every platform Sealmetrics supports.
