{"id":21599175,"url":"https://github.com/gridonic/statamic-consent-manager","last_synced_at":"2026-02-18T10:34:51.082Z","repository":{"id":62512748,"uuid":"398892406","full_name":"gridonic/statamic-consent-manager","owner":"gridonic","description":"A Statamic 3 addon to manage consent for cookies 🍪.","archived":false,"fork":false,"pushed_at":"2024-12-11T08:59:04.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-08-15T23:15:50.322Z","etag":null,"topics":["cookie-consent","statamic-3","statamic-addon"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gridonic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-08-22T20:16:06.000Z","updated_at":"2024-12-11T07:33:11.000Z","dependencies_parsed_at":"2025-05-05T22:33:52.663Z","dependency_job_id":"a12b24ef-0dfa-4281-a70e-5e1120c7ec8c","html_url":"https://github.com/gridonic/statamic-consent-manager","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/gridonic/statamic-consent-manager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridonic%2Fstatamic-consent-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridonic%2Fstatamic-consent-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridonic%2Fstatamic-consent-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridonic%2Fstatamic-consent-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gridonic","download_url":"https://codeload.github.com/gridonic/statamic-consent-manager/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridonic%2Fstatamic-consent-manager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29576633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T08:38:15.585Z","status":"ssl_error","status_checked_at":"2026-02-18T08:38:14.917Z","response_time":162,"last_error":"SSL_read: 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":["cookie-consent","statamic-3","statamic-addon"],"created_at":"2024-11-24T18:14:35.660Z","updated_at":"2026-02-18T10:34:46.062Z","avatar_url":"https://github.com/gridonic.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Statamic Consent Manager\n\nA Statamic 3 addon to manage consent for cookies 🍪.\n\n**Features**\n\n* Define consent groups _and_ scripts loaded dynamically only when consent for a group is given.\n* Provides a simple javascript API to read and change consent for users.\n* Consent is stored client-side only, making it possible to use the static cache.\n\n## Installation\n\nRun the following commands:\n\n```\ncomposer require gridonic/statamic-consent-manager\nphp artisan vendor:publish --tag=statamic-consent-manager-config\n```\n\n## Configuration\n\nEdit the configuration file located in `config/statamic/consent_manager.php`:\n\n```php\n\u003c?php\n\nreturn [\n    // Where to store the consent settings of any user (javascript).\n    // Choose \"local\" for local storage or \"session\" for session storage.\n    'storage' =\u003e 'local',\n\n    // Consent groups managed by the addon. Feel free to change, remove or add your own groups.\n    // Scripts are dynamically added to the DOM only if consent for their group is given.\n    'groups' =\u003e [\n        'necessary' =\u003e [\n            'required' =\u003e true,\n            'consented' =\u003e true,\n            'scripts' =\u003e [\n                [\n                    // The full script tag to include in the page if consent is given.\n                    'tag' =\u003e '\u003cscript\u003econsole.log(\\'script dynamically loaded with consent manager\\');\u003c/script\u003e',\n                    // Choose \"head\" or \"body\" to append the script to the page.\n                    'appendTo' =\u003e 'head',\n                ],\n            ],\n        ],\n        'marketing' =\u003e [\n            'required' =\u003e false,\n            'consented' =\u003e false,\n            'scripts' =\u003e [],\n        ],\n        'statistics' =\u003e [\n            'required' =\u003e false,\n            'consented' =\u003e false,\n            'scripts' =\u003e [],\n        ]\n    ],\n];\n```\n## Usage\n\n1. Define your consent groups and their scripts in the configuration. \n2. Add the `{{ consent_manager }}` tag in the `head` of your layout.\n\nThat's it! 🥳 What's left up to you is to design a nice cookie banner and\nmodify consent data by using the javascript API.\n\n### Rendering a cookie banner\n\nThe addon provides the tag `{{ consent_manager:groups }}` which can be used to loop over\nconsent groups in Antlers.\n\n```\n{{ consent_manager:groups }}\n    Group ID: {{ id }}\n    Consented by default: {{ consented }}\n    Required: {{ required }}  \n{{ /consent_manager:groups }}\n```\n\n\u003e ℹ️ To read of modify consent, you need to use the javascript API, because the data is stored client-side only.\n\n### Javascript API\n\nThe addon exposes a `window.consentManager` object to read and write consent data.\n\n| Method | Description |\n| --- | --- |\n| `getConsent(group: string): boolean` | Check if the user has consented to a group. |\n| `setConsent(group: string, consent: boolean)` | Set or remove consent to a group. If consent is given, all scripts of the group are appended to the DOM. |\n| `isRequired(group: string): boolean` | Check if a group is required. |\n| `getGroups(): Array` | Get all consent groups. |\n| `getGroup(group: string): Object` | Get information about a single group. |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgridonic%2Fstatamic-consent-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgridonic%2Fstatamic-consent-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgridonic%2Fstatamic-consent-manager/lists"}