This project provides a fully self-contained, dependency-free cookie consent banner designed to meet Google’s consent requirements. It is written in pure HTML, CSS, and JavaScript, and is suitable for use in the Australian market under the Privacy Act and relevant Google policies.
- Fully aligned with Google’s EU user consent policy (applicable in Australia if using Google services)
- Platform-independent: no frameworks, no dependencies
- Consent data stored in
localStorage - Compatible with Google Tag Manager (GTM) and
gtag.js - Minimal footprint and no external calls
- Customisable design and logic
index.html # Single-file implementation (HTML, CSS, JS inlined) README.md # Project documentation
- Displays a simple, accessible cookie banner
- Users can accept or reject cookies
- Consent is applied via the
gtag('consent', ...)API - GTM-compatible
dataLayerinitialisation included - Consent is persistent across sessions (via
localStorage)
- Replace styling in the
<style>block to match your brand - Update the privacy policy link (
/privacy-policy/) - Insert your actual GTM container ID where indicated
- Modify consent logic to use cookies instead of
localStorageif required
This implementation helps site owners comply with consent requirements when using Google services (such as Google Ads, Google Analytics, or GTM) in Australia. While Australia does not have a direct equivalent to the EU GDPR, Google's policies still apply to Australian publishers and advertisers.
You are responsible for ensuring your own compliance with the Australian Privacy Principles (APPs) and Google's policies.
- All modern browsers (Chrome, Firefox, Safari, Edge)
- No ES6+ features used
MIT — free to use, modify, and distribute.
Note: This is not legal advice. Always consult a qualified professional to ensure your compliance obligations are met.