This project is not covered by Drupal’s security advisory policy.

Connect Drupal to Google Analytics 4 and Search Console to add tracking and verification tags, and view traffic and search performance reports in an admin dashboard.

Features

Site Kit connects a Drupal site with Google Analytics 4 (GA4) and Google Search Console. It adds the GA4 tracking tag and Search Console verification tag to public pages, and provides an administration dashboard for reports from both services.

The dashboard can show GA4 visitors and sessions, daily visitor charts, traffic channels, locations, devices, key events, top content, and visitors from organic search. Search Console reports include clicks, impressions, search queries, locations, devices, and top pages. Reports can be viewed over 7-, 28-, or 90-day periods and compared with the previous period.

Use Site Kit when you want to configure these integrations and review their reports from Drupal. The GA4 tracking tag works independently of the reporting connection.

Post-Installation

After installing and enabling the module:

  1. Go to Configuration > Web services > Site Kit (/admin/config/services/sitekit).
  2. Enter your GA4 Measurement ID to add the tracking tag. Enter your Search Console HTML verification token if you want Site Kit to add the verification tag.
  3. To enable reports, enter your numeric GA4 Property ID and your Search Console property, using its exact URL or domain format (for example, sc-domain:example.com).
  4. In Google Cloud Console, enable the Google Analytics Data API and/or Google Search Console API for the reports you want to use.
  5. Create a Google OAuth client ID for a web application. Add the authorized redirect URI shown on the Site Kit settings page to the OAuth client, then enter its client ID and secret in Drupal.
  6. Select Connect Google account and authorize access. Reports are available at Reports > Site Kit (/admin/reports/sitekit).

The Google account used for authorization must have access to the relevant Analytics property and Search Console property. Grant the Administer Site Kit permission only to roles that should configure the integration or view its reports.

The OAuth client secret and tokens are stored in Drupal's database-backed state storage, not in configuration exports. Protect database access and backups. Site owners are responsible for providing appropriate privacy notices and obtaining visitor consent where required.

Additional Requirements

  • Drupal 10 or 11.
  • A Google Analytics 4 property and, for reports, its numeric Property ID.
  • A verified Search Console property to use Search Console tags or reports.
  • A Google Cloud project with the relevant API enabled and a web application OAuth client for reports.

No additional Drupal modules or Composer libraries are required. Enable the Google Analytics Data API for Analytics reports and the Google Search Console API for Search Console reports; enable both to use both sets of reports.

Recommended modules/libraries

No additional modules or libraries are required.

Similar projects

Google Site Kit is available for WordPress. Site Kit for Drupal provides a Drupal-native settings page and reports dashboard for GA4 and Search Console. It is a community project and is not an official Google product.

Supporting this Module

Contributions, issue reports, and documentation improvements are welcome through the project issue queue.

Community Documentation

See the project README for setup details, including Google API and OAuth configuration.

Project information

Releases