{"id":44878965,"url":"https://github.com/isap-ou/statamic-lead-insights","last_synced_at":"2026-02-17T15:30:30.209Z","repository":{"id":338697099,"uuid":"1158750723","full_name":"isap-ou/statamic-lead-insights","owner":"isap-ou","description":"Know where your leads come from. Captures UTM parameters, referrers, and landing pages — attaches them to Statamic form submissions.","archived":false,"fork":false,"pushed_at":"2026-02-15T23:06:21.000Z","size":75,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-16T06:00:35.056Z","etag":null,"topics":["attribution","forms","leads","statamic","statamic-addon","statamic-v6","utm"],"latest_commit_sha":null,"homepage":"https://statamic.com/addons/isapp/lead-insights","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/isap-ou.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-15T21:23:38.000Z","updated_at":"2026-02-15T23:08:10.000Z","dependencies_parsed_at":"2026-02-16T06:00:37.288Z","dependency_job_id":null,"html_url":"https://github.com/isap-ou/statamic-lead-insights","commit_stats":null,"previous_names":["isap-ou/statamic-lead-insights"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/isap-ou/statamic-lead-insights","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isap-ou%2Fstatamic-lead-insights","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isap-ou%2Fstatamic-lead-insights/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isap-ou%2Fstatamic-lead-insights/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isap-ou%2Fstatamic-lead-insights/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isap-ou","download_url":"https://codeload.github.com/isap-ou/statamic-lead-insights/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isap-ou%2Fstatamic-lead-insights/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29548270,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T14:33:00.708Z","status":"ssl_error","status_checked_at":"2026-02-17T14:32:58.657Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["attribution","forms","leads","statamic","statamic-addon","statamic-v6","utm"],"created_at":"2026-02-17T15:30:29.602Z","updated_at":"2026-02-17T15:30:30.202Z","avatar_url":"https://github.com/isap-ou.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lead Insights for Statamic\n\n**Know where your leads come from — without sacrificing their privacy.**\n\nLead 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.\n\nNo database required. No third-party scripts. No cookies without consent.\n\n---\n\n## Features\n\n- Automatic UTM capture (source, medium, campaign, term, content)\n- Referrer and landing page tracking\n- Attribution data attached to every form submission\n- Dashboard widgets with lead counts and share percentages\n- First-party cookie with configurable TTL\n- Consent-gated by default (EU-first)\n- Works with any cookie-based consent management platform\n- Flat-file storage — no database migrations, no external services\n- Available in English, German, and Dutch\n\n## Free vs Pro\n\n| Feature | Free | Pro |\n|---|:---:|:---:|\n| UTM capture \u0026 form enrichment | ✓ | ✓ |\n| Consent gating (EU-first) | ✓ | ✓ |\n| Configurable cookie \u0026 attribution key | ✓ | ✓ |\n| Leads by Source widget | ✓ | ✓ |\n| Leads by Campaign widget | | ✓ |\n| Leads by Form widget | | ✓ |\n| Form → Source Breakdown widget | | ✓ |\n| CSV export | | ✓ |\n| Data retention \u0026 prune command | | ✓ |\n| First-touch + last-touch attribution | | ✓ |\n\n## Installation\n\n```bash\ncomposer require isapp/statamic-lead-insights\n```\n\nThe addon registers automatically via Statamic's addon discovery.\n\n## How It Works\n\n**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.\n\n**2. Enrich** — When a visitor submits a Statamic form, the attribution payload is automatically attached to the submission. No form changes needed.\n\n**3. Visualize** — Dashboard widgets show which sources, campaigns, and forms drive the most leads. Export the data as CSV for deeper analysis.\n\n## Configuration\n\nAll settings are managed in the Control Panel under **Addons → Lead Insights**.\n\n### General\n\n| Setting | Default | Description |\n|---|---|---|\n| `enabled` | `true` | Enable or disable the addon globally |\n| `attribution_key` | `__attribution` | Key used to store attribution data on submissions |\n| `cookie_name` | `lead_insights_attribution` | Name of the first-party cookie |\n| `cookie_ttl_days` | `30` | Days the attribution cookie persists |\n\n### Consent / GDPR\n\n| Setting | Default | Description |\n|---|---|---|\n| `consent_required` | `true` | Require consent before storing cookies |\n| `consent_cookie_name` | — | Cookie name to check for marketing consent |\n| `consent_cookie_value` | — | Expected value (empty = presence check only) |\n| `store_landing_without_consent` | `true` | Store landing URL even without consent |\n| `store_referrer_without_consent` | `false` | Store referrer without consent |\n\n### Reporting\n\n| Setting | Default | Description |\n|---|---|---|\n| `top_n` | `10` | Maximum rows shown in dashboard widgets |\n| `default_date_range_days` | `30` | Default date range for widgets |\n\n### Retention (Pro)\n\n| Setting | Default | Description |\n|---|---|---|\n| `retention_days` | `365` | Days to keep attribution data before pruning |\n| `prune_schedule_enabled` | `false` | Enable automatic scheduled pruning |\n| `prune_schedule_frequency` | `daily` | How often to prune: daily, weekly, or monthly |\n| `prune_schedule_time` | `02:00` | Time of day to run (HH:MM, 24-hour format) |\n\n## Widgets\n\nWidgets are registered automatically but need to be added to your dashboard. Add them in `config/statamic/cp.php`:\n\n```php\n'widgets' =\u003e [\n    ['type' =\u003e 'leads_by_source', 'width' =\u003e 50],\n    ['type' =\u003e 'leads_by_campaign', 'width' =\u003e 50],\n    ['type' =\u003e 'leads_by_form', 'width' =\u003e 50],\n    ['type' =\u003e 'form_source_breakdown', 'width' =\u003e 50, 'form' =\u003e 'contact'],\n],\n```\n\n### Leads by Source (Free)\n\nGroups form submissions by `utm_source` — see which traffic sources generate the most leads.\n\n### Leads by Campaign (Pro)\n\nGroups submissions by `utm_campaign` — measure which campaigns convert.\n\n### Leads by Form (Pro)\n\nGroups submissions by form handle — find out which forms get the most attributed leads.\n\n### Form → Source Breakdown (Pro)\n\nSelect a specific form and see a per-source breakdown. Configure the `form` handle in widget settings.\n\nAll widgets display a table with **Label**, **Leads**, and **Share %** columns, filtered by the configured date range.\n\n## CSV Export (Pro)\n\nExport any widget's data as a CSV file. Available export types:\n\n- `source` — Leads by source\n- `campaign` — Leads by campaign\n- `form` — Leads by form\n- `form_source` — Source breakdown for a specific form\n\nAccess exports from the Control Panel or via:\n\n```\nGET /cp/lead-insights/export?type=source\u0026days=30\n```\n\nRequires the **Export Lead Insights** permission.\n\n## Data Retention (Pro)\n\nRemove old attribution data while keeping form submissions intact:\n\n```bash\nphp artisan lead-insights:prune\n```\n\nThis strips the `__attribution` key from submissions older than the configured `retention_days` (default: 365). The submissions themselves are preserved.\n\nOverride the retention period per run:\n\n```bash\nphp artisan lead-insights:prune --days=90\n```\n\n### Automatic scheduling\n\nEnable 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.\n\nMake sure `php artisan schedule:run` is set up in your server's crontab.\n\n## Privacy \u0026 GDPR\n\nLead Insights is designed EU-first. Consent is required by default — no cookie is set and no UTM data is stored until consent is detected.\n\n### What is NOT collected\n\n- IP addresses\n- User-agent strings\n- Browser fingerprints\n- Click IDs (gclid, fbclid, etc.)\n- Cross-site or third-party tracking data\n\n### Cookie properties\n\n- First-party only\n- `SameSite=Lax`\n- `Secure` on HTTPS\n- `HttpOnly`\n- Configurable name and TTL\n\n### Consent integration\n\nLead 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.\n\n### Without consent\n\nWhen `consent_required` is `true` (default) and no consent is detected:\n\n- No cookie is set\n- No UTM parameters are stored\n- Only the landing URL and timestamp are attached at form submission time (configurable)\n\n## Permissions\n\n| Permission | Edition | Description |\n|---|---|---|\n| View Lead Insights | Free + Pro | Access dashboard widgets |\n| Export Lead Insights | Pro | Download CSV exports |\n\nAssign permissions to roles in **CP → Users → Roles**.\n\n## Requirements\n\n- Statamic 6\n- PHP 8.2+\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisap-ou%2Fstatamic-lead-insights","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisap-ou%2Fstatamic-lead-insights","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisap-ou%2Fstatamic-lead-insights/lists"}