analyze
Unified Content Analysis Framework for Drupal
The Analyze module provides a unified API framework that brings together diverse content analysis tools under a single, accessible interface, transforming how content editors understand and optimize their content.
Core Features
-
Unified Analysis Tab
Adds a consistent "Analyze" tab to all entities with canonical URLs, providing a central location for all content insights.
-
Extensible API Framework
Offers a robust API for modules to integrate their analysis data, ensuring consistency across different analysis tools.
-
Visual Data Components
Includes linear gauge components and tables for intuitive spectrum-based data visualization.
Compatible Analysis Modules
Modules marked with an asterisk (*) are included in the Analyze projectName Description Key Metrics
Analyze Basic Content Info*
Provides fundamental content metrics. Word count, Image countAnalyze Google Analytics*
Integrates Google Analytics data into content analysis. Page views, Views per user, Bounce rateAnalyze Node Statistics*
Provides basic traffic statistics using Drupal's Statistics module. Total page views, Today's viewsAnalyze Plugin Example*
A developer reference for creating custom analyzers and reports. Custom metrics, Gauge, Table componentsAI Brand Voice Analysis
Analyzes content for brand voice consistency. Brand voice alignment scoreAI Sentiments Analysis
Analyzes the sentiment of content using AI models. Trust, Objectivity, Audience targeting, Reading levelAI Content Marketing Audit
Evaluates content against marketing best practices. Usability, Knowledge level, Actionability, Business valueAI Content Security Audit
Identifies potential security risks in content. PII disclosure, Credentials exposure, Risk scoresProblem Addressed
Content analysis modules, such as Realtime SEO, Google Analytics Node Reports, and Editoria11y, often feature inconsistent UI designs. The Statistics module, formerly in core, lacks an accessible UI. These discrepancies make it difficult for content editors to use these tools effectively.
The Analyze module unifies these tools within the "Analyze" tab. Concise reports appear on the main tab, while more detailed reports are accessible via secondary tabs.
User Experience
- Up to three key metrics are shown on the main "Analyze" tab using tables and gauges.
- Full reports can be displayed in secondary tabs or sitewide dashboards.
- This ensures critical data is accessible, with deeper insights available when needed.
Setup
After enabling the module on the Extend page as usual:
- Navigate to Configuration > System > Analyze Settings.
- Enable desired analysis features for specific content types by toggling the available options (e.g., Basic Content, Google Analytics, Node Statistics).
- Once configured, the "Analyze" tab will appear on entity pages, displaying metrics and reports.
For example:
- The main "Analyze" tab displays concise information, such as word count or page views.
- More detailed reports, like Google Analytics summaries, are available on secondary tabs or linked to sitewide dashboards.
Prefer a turnkey demo site?
Spin up DXPR CMS—Drupal pre-configured with DXPR Builder, DXPR Theme, Analyze module, and security best practices.
Example configuration:
Creating a custom plugin to display information
1. File Structure
my_module/
├── my_module.info.yml
├── src/
│ └── Plugin/
│ └── Analyze/
│ └── MyAnalyzer.php
2. Example Plugin
See the full example for details. Here's a basic structure:
namespace Drupal\my_module\Plugin\Analyze;
use Drupal\Core\Entity\EntityInterface;
use Drupal\analyze\AnalyzePluginBase;
/**
* @Analyze(
* id = "my_analyzer",
* label = @Translation("My Analyzer"),
* description = @Translation("Provides custom analysis functionality.")
* )
*/
final class MyAnalyzer extends AnalyzePluginBase {
public function renderSummary(EntityInterface $entity): array {
return [
'#theme' => 'analyze_table',
'#table_title' => 'My Analysis',
'#row_one' => ['label' => 'Metric One', 'data' => 'Value 1'],
'#row_two' => ['label' => 'Metric Two', 'data' => 'Value 2'],
];
}
public function renderFullReport(EntityInterface $entity): array {
return [
'#type' => 'fieldset',
'#title' => $this->t('Full Analysis'),
'gauge' => [
'#theme' => 'analyze_gauge',
'#caption' => 'Performance Score',
'#range_min_label' => 'Poor',
'#range_max_label' => 'Excellent',
'#value' => 75,
'#display_value' => '75%',
],
];
}
}
3. Display Components
analyze_tablefor key metrics.analyze_gaugefor spectrum-based data.
Developers can integrate these components to display their analysis on the "Analyze" tab. Configuration and UI are implemented by extending modules.