If your website has visitors from the European Economic Area (EEA), you're legally required to obtain valid user consent before using cookies or tracking technologies. This includes essential services like progressive web apps (PWAs), push notifications, and analytics.
Liteit.app enhances your website by turning it into a PWA with advanced features like installability and notification delivery. To comply with privacy laws such as the GDPR, it’s important to integrate Liteit with a Consent Management Platform (CMP) — and in this tutorial, we’ll show you how to do it using CookieYes.
Why Consent Matters
Under GDPR and similar regulations, you must ask for user permission before storing or accessing non-essential cookies. Even though Liteit.app only uses cookies for functional purposes — such as enabling installation or offline capabilities — these still require consent in some jurisdictions.
Without consent, features like push notifications or analytics might not function as expected — or may violate legal guidelines. Liteit also includes optional, anonymous analytics. These are enabled by default unless explicitly disabled by you or denied by the user.
To disable Liteit.app’s analytics tracking manually, set the following at the top of your script:
window.LIA_API = window.LIA_API || {};
window.LIA_API.runAnalytics = false;
How to Integrate Liteit.app with CookieYes CMP
- Open CookieYes Dashboard, go to “Advanced Settings,” and click Get Installation Code.
- Copy the installation code snippet. If you use a website builder, follow its documentation to place it in the
<head>
tag of every page. - Paste the CookieYes script in the
<head>
tag, then add the code snippet below to load Liteit.app based on user consent.
Below is a working setup that ensures Liteit.app only runs after the user consents to functional cookies. It also conditionally disables analytics tracking based on cookie preferences.
<script>
//Start of LiteIt.App Integration
(function(d, t) {
var s = d.createElement(t), f = d.getElementsByTagName(t)[0];
s.src = "https://embed.liteit.app/?appid=xxxx"; // Replace 'xxxx' with your actual App ID
s.id = Date.now();
f.parentNode.insertBefore(s, f);
})(document, "script");
//End of LiteIt.App Integration
// Declare consent wait state
window.LIA_API = window.LIA_API || {};
window.LIA_API.waitConsent = true;
function runCookieBasedScripts(consent) {
// Run Liteit.app only if user allows functional cookies
if (
(consent.accepted && consent.accepted.includes('functional')) ||
(consent.categories && consent.categories.functional)
) {
window.LIA_API.runLia();
}
// Disable analytics tracking if not explicitly accepted
if (
!((consent.accepted && consent.accepted.includes('analytics')) ||
(consent.categories && consent.categories.analytics))
) {
window.LIA_API.runAnalytics = false;
}
}
// Run scripts after CookieYes banner loads with stored consent
document.addEventListener("cookieyes_banner_load", function () {
if (window.getCkyConsent) {
const consent = getCkyConsent();
runCookieBasedScripts(consent);
}
});
// Run scripts again when user updates preferences
document.addEventListener('cookieyes_consent_update', function (event) {
runCookieBasedScripts(event.detail);
});
</script>
<!-- CookieYes banner script -->
<script id="cookieyes" type="text/javascript" src="https://cdn-cookieyes.com/client_data/xxxxxxxxxxxx/script.js"></script>