PHPackages                             alt-design/alt-cookies - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. alt-design/alt-cookies

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

alt-design/alt-cookies
======================

Helps handle scripts and cookies on your Statamic site

v1.2.3(3w ago)33.7k↑123.3%1[5 issues](https://github.com/alt-design/Alt-Cookies-Addon/issues)MITPHP

Since Apr 9Pushed 3w ago2 watchersCompare

[ Source](https://github.com/alt-design/Alt-Cookies-Addon)[ Packagist](https://packagist.org/packages/alt-design/alt-cookies)[ RSS](/packages/alt-design-alt-cookies/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (4)Versions (21)Used By (0)

Alt Cookies Addon
=================

[](#alt-cookies-addon)

> Easily manage consent for Google consent mode v2 and other optional tracking

Features
--------

[](#features)

This addon features:

- Ez Google Analytics controls
- Custom Cookie Lifetime
- Necessary, Analytics and Advertising Cookies fields
- Replaceable default consent popup

How to Install
--------------

[](#how-to-install)

You can search for this addon in the `Tools > Addons` section of the Statamic control panel and click **install**, or run the following command from your project root:

```
composer require alt-design/alt-cookies
```

Basic Use
---------

[](#basic-use)

To enable the default consent popup:

- Open up your main `Template.antlers.html` or equivalent
- Add our `{{ AltCookies:Toast }}` tag before the closing `` tag
- Add a way to change the preferences, up to you here, but for example, `Cookie Preferences`
- You're away!!

To configure Google Analytics :

- Navigate to your `Control Panel > Alt Cookies`
- Head to the `Google` tab
- Simply enter your Google Tag ID
- Add our consent popup or make sure the Alt Cookies scripts are loaded if you're doing a custom popup

To configure other tracking :

- Navigate to your `Control Panel > Alt Cookies`
- Head to the `General` tab
- Add your `` tags for other tracking here in the appropriate boxes.
- Note that `Analytics` and `Advertising` can be toggled.
- These will then get put on page according to the consent level the user agreed to.
- `Necessary` cookies always appear on page
- WARNING : These fields place what you put in them onto the page. Please check for errors and make sure that the code you put in here is safe.

Advanced Use
------------

[](#advanced-use)

To build a custom cookie popup:

- Open up your master `Template.antlers.html` or equivalent
- Add our `{{ AltCookies:Scripts }}` tag to your popup view.
- You'll need an "Accept" and "Accept Necessary" button.
- The "Accept" button needs to have `{{ AltCookies:accept }}` in it's onclick
- The "Accept Necessary" button needs to have `{{ AltCookies:decline }}` in it's onclick
- You will then need at least 2 checkboxes to configure analytics and advertising cookies.
- The Analytics checkbox requires an id of `alt-cookies-analytics` for the Javascript to hook into
- The Analytics checkbox requires an id of `alt-cookies-advertising` for the Javascript to hook into
- If you just want to allow `Necessary` and `All` cookies as your options, then you could hide these checkboxes and give them the `checked` property. They just need to exist.

Questions etc
-------------

[](#questions-etc)

Drop us a big shout-out if you have any questions, comments, or concerns. We're always looking to improve our addons, so if you have any feature requests, we'd love to hear them.

### Starter Kits

[](#starter-kits)

- [Alt Starter Kit](https://statamic.com/starter-kits/alt-design/alt-starter-kit)

### Addons

[](#addons)

- [Alt Redirect Addon](https://github.com/alt-design/Alt-Redirect-Addon)
- [Alt Sitemap Addon](https://github.com/alt-design/Alt-Sitemap-Addon)
- [Alt Akismet Addon](https://github.com/alt-design/Alt-Akismet-Addon)
- [Alt Password Protect Addon](https://github.com/alt-design/Alt-Password-Protect-Addon)
- [Alt Cookies Addon](https://github.com/alt-design/Alt-Cookies-Addon)
- [Alt Inbound Addon](https://github.com/alt-design/Alt-Inbound-Addon)
- [Alt Google 2FA Addon](https://github.com/alt-design/Alt-Google-2fa-Addon)

Postcardware
------------

[](#postcardware)

Send us a postcard from your hometown if you like this addon. We love getting mail from other cool peeps!

Alt Design
St Helens House Derby
DE1 3EE UK

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance75

Regular maintenance activity

Popularity27

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~46 days

Recently: every ~157 days

Total

18

Last Release

24d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5221940?v=4)[Alt Design](/maintainers/alt-design)[@alt-design](https://github.com/alt-design)

---

Top Contributors

[![Alt-Ben](https://avatars.githubusercontent.com/u/12431318?v=4)](https://github.com/Alt-Ben "Alt-Ben (20 commits)")[![benmAltDesign](https://avatars.githubusercontent.com/u/149595159?v=4)](https://github.com/benmAltDesign "benmAltDesign (18 commits)")[![Alt-Charlie](https://avatars.githubusercontent.com/u/260397567?v=4)](https://github.com/Alt-Charlie "Alt-Charlie (15 commits)")[![nat-alt](https://avatars.githubusercontent.com/u/100426312?v=4)](https://github.com/nat-alt "nat-alt (9 commits)")

### Embed Badge

![Health badge](/badges/alt-design-alt-cookies/health.svg)

```
[![Health](https://phpackages.com/badges/alt-design-alt-cookies/health.svg)](https://phpackages.com/packages/alt-design-alt-cookies)
```

###  Alternatives

[statamic/seo-pro

68516.6k](/packages/statamic-seo-pro)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[rias/statamic-redirect

29335.6k](/packages/rias-statamic-redirect)[jacksleight/statamic-bard-texstyle

18195.4k](/packages/jacksleight-statamic-bard-texstyle)[marcorieser/statamic-livewire

A Laravel Livewire integration for Statamic.

23111.5k14](/packages/marcorieser-statamic-livewire)[withcandour/aardvark-seo

Save time and get your Statamic site to rank better with the SEO addon for Statamic.

15133.0k](/packages/withcandour-aardvark-seo)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
