isapp/statamic-lead-insights
Composer 安装命令:
composer require isapp/statamic-lead-insights
包简介
Know where your leads come from. Captures UTM parameters, referrers, and landing pages — attaches them to Statamic form submissions.
README 文档
README
Know where your leads come from — without sacrificing their privacy.
Lead Insights automatically captures UTM parameters, referrers, and landing pages from your visitors and attaches them to Statamic form submissions. See which campaigns, sources, and pages drive real conversions — right from your Control Panel dashboard.
No database required. No third-party scripts. No cookies without consent.
Features
- Automatic UTM capture (source, medium, campaign, term, content)
- Referrer and landing page tracking
- Attribution data attached to every form submission
- Dashboard widgets with lead counts and share percentages
- First-party cookie with configurable TTL
- Consent-gated by default (EU-first)
- Works with any cookie-based consent management platform
- Flat-file storage — no database migrations, no external services
- Available in English, German, and Dutch
Free vs Pro
| Feature | Free | Pro |
|---|---|---|
| UTM capture & form enrichment | ✓ | ✓ |
| Consent gating (EU-first) | ✓ | ✓ |
| Configurable cookie & attribution key | ✓ | ✓ |
| Leads by Source widget | ✓ | ✓ |
| Leads by Campaign widget | ✓ | |
| Leads by Form widget | ✓ | |
| Form → Source Breakdown widget | ✓ | |
| CSV export | ✓ | |
| Data retention & prune command | ✓ | |
| First-touch + last-touch attribution | ✓ |
Installation
composer require isapp/statamic-lead-insights
The addon registers automatically via Statamic's addon discovery.
How It Works
1. Capture — A lightweight middleware reads UTM parameters, the referrer, and the landing URL on every page visit. If consent is given, it stores the data in a first-party cookie.
2. Enrich — When a visitor submits a Statamic form, the attribution payload is automatically attached to the submission. No form changes needed.
3. Visualize — Dashboard widgets show which sources, campaigns, and forms drive the most leads. Export the data as CSV for deeper analysis.
Configuration
All settings are managed in the Control Panel under Addons → Lead Insights.
General
| Setting | Default | Description |
|---|---|---|
enabled |
true |
Enable or disable the addon globally |
attribution_key |
__attribution |
Key used to store attribution data on submissions |
cookie_name |
lead_insights_attribution |
Name of the first-party cookie |
cookie_ttl_days |
30 |
Days the attribution cookie persists |
Consent / GDPR
| Setting | Default | Description |
|---|---|---|
consent_required |
true |
Require consent before storing cookies |
consent_cookie_name |
— | Cookie name to check for marketing consent |
consent_cookie_value |
— | Expected value (empty = presence check only) |
store_landing_without_consent |
true |
Store landing URL even without consent |
store_referrer_without_consent |
false |
Store referrer without consent |
Reporting
| Setting | Default | Description |
|---|---|---|
top_n |
10 |
Maximum rows shown in dashboard widgets |
default_date_range_days |
30 |
Default date range for widgets |
Retention (Pro)
| Setting | Default | Description |
|---|---|---|
retention_days |
365 |
Days to keep attribution data before pruning |
prune_schedule_enabled |
false |
Enable automatic scheduled pruning |
prune_schedule_frequency |
daily |
How often to prune: daily, weekly, or monthly |
prune_schedule_time |
02:00 |
Time of day to run (HH:MM, 24-hour format) |
Widgets
Widgets are registered automatically but need to be added to your dashboard. Add them in config/statamic/cp.php:
'widgets' => [ ['type' => 'leads_by_source', 'width' => 50], ['type' => 'leads_by_campaign', 'width' => 50], ['type' => 'leads_by_form', 'width' => 50], ['type' => 'form_source_breakdown', 'width' => 50, 'form' => 'contact'], ],
Leads by Source (Free)
Groups form submissions by utm_source — see which traffic sources generate the most leads.
Leads by Campaign (Pro)
Groups submissions by utm_campaign — measure which campaigns convert.
Leads by Form (Pro)
Groups submissions by form handle — find out which forms get the most attributed leads.
Form → Source Breakdown (Pro)
Select a specific form and see a per-source breakdown. Configure the form handle in widget settings.
All widgets display a table with Label, Leads, and Share % columns, filtered by the configured date range.
CSV Export (Pro)
Export any widget's data as a CSV file. Available export types:
source— Leads by sourcecampaign— Leads by campaignform— Leads by formform_source— Source breakdown for a specific form
Access exports from the Control Panel or via:
GET /cp/lead-insights/export?type=source&days=30
Requires the Export Lead Insights permission.
Data Retention (Pro)
Remove old attribution data while keeping form submissions intact:
php artisan lead-insights:prune
This strips the __attribution key from submissions older than the configured retention_days (default: 365). The submissions themselves are preserved.
Override the retention period per run:
php artisan lead-insights:prune --days=90
Automatic scheduling
Enable automatic pruning in Addons → Lead Insights → Retention. Choose a frequency (daily, weekly, or monthly) and a time of day. The addon registers the schedule automatically — no changes to routes/console.php needed.
Make sure php artisan schedule:run is set up in your server's crontab.
Privacy & GDPR
Lead Insights is designed EU-first. Consent is required by default — no cookie is set and no UTM data is stored until consent is detected.
What is NOT collected
- IP addresses
- User-agent strings
- Browser fingerprints
- Click IDs (gclid, fbclid, etc.)
- Cross-site or third-party tracking data
Cookie properties
- First-party only
SameSite=LaxSecureon HTTPSHttpOnly- Configurable name and TTL
Consent integration
Lead Insights works with any cookie-based consent management platform (Cookiebot, CookieYes, Complianz, etc.). Configure the consent cookie name and expected value in settings. No built-in consent banner — it respects your existing setup.
Without consent
When consent_required is true (default) and no consent is detected:
- No cookie is set
- No UTM parameters are stored
- Only the landing URL and timestamp are attached at form submission time (configurable)
Permissions
| Permission | Edition | Description |
|---|---|---|
| View Lead Insights | Free + Pro | Access dashboard widgets |
| Export Lead Insights | Pro | Download CSV exports |
Assign permissions to roles in CP → Users → Roles.
Requirements
- Statamic 6
- PHP 8.2+
isapp/statamic-lead-insights 适用场景与选型建议
isapp/statamic-lead-insights 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 23 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 02 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「analytics」 「Forms」 「marketing」 「lead」 「UTM」 「statamic」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 isapp/statamic-lead-insights 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 isapp/statamic-lead-insights 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 isapp/statamic-lead-insights 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
ConfirmationField is a form field for Atk14 applications. It's like the BooleanField (checkbox) but the ConfirmationField must be ticked.
Field for number with restricted count of digits and decimal places
Analytics chooser extensions for site settings.
Historical accounting for contacts
HTML and form generation
Build forms from schema
统计信息
- 总下载量: 23
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 34
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2026-02-15