Quick Start
Get your cookie consent banner live in three steps.
1. Add the script tag
Add the LiteConsent script to the <head> of every page on your site. You'll find your unique snippet in the dashboard after creating a site.
<script src="https://cdn.liteconsent.com/s/YOUR_SITE_ID/c.js"></script> <script src="https://cdn.liteconsent.com/lc.js"></script>
The first script (c.js) contains your compiled settings (categories, rules, consent config). The second (lc.js) is the runtime that reads the config and manages consent. Both load quickly and won't block page rendering.
2. Configure your banner
In the LiteConsent dashboard, navigate to your site's configuration page. Here you can:
- Choose which jurisdictions to support
- Customize colors, layout, and fonts
- Set up cookie categories
- Add language translations
3. Control your scripts
Choose how LiteConsent blocks scripts until consent is granted. The simplest method is markup mode: add a data-consent attribute to your script tags and move the URL to data-src.
<!-- This script only runs when "analytics" consent is granted -->
<script data-src="https://example.com/analytics.js"
type="text/plain"
data-consent="analytics"></script>
Set type="text/plain" to prevent the browser from executing the script before LiteConsent processes it. When the visitor grants consent for that category, LiteConsent creates a new <script> element with the original data-src URL, replacing the blocked one.
For more advanced setups, see the full Integration guide.