Cookie Consent
Configure the GDPR cookie consent banner and privacy settings.
Privacy compliance is essential. Reward Loyalty includes a built-in cookie consent banner to help you meet GDPR and other privacy regulations.
Enabling the Banner
The cookie consent banner is controlled via your environment settings.
- Open your
.envfile in the root directory - Find or add the
APP_COOKIE_CONSENTsetting:
APP_COOKIE_CONSENT=true
- true: Shows the banner to all visitors
- false: Hides the banner (default)
When enabled, visitors will see a banner asking them to accept or decline cookies.
How It Works
When a user makes a choice, their preference is saved in a cookie_consent cookie.
- Accept: The system allows tracking scripts to run.
- Decline: Tracking scripts are blocked.
Checking Consent in Code
If you're developing custom features, you can check for consent in your PHP code:
use App\Http\Controllers\Cookie\CookieController;
if (CookieController::userConsentsToCookies()) {
// Safe to run tracking code or store non-essential cookies
}
Checking Consent in Themes
In your Blade templates, you can conditionally load scripts (like Google Analytics) based on consent:
@if (\App\Http\Controllers\Cookie\CookieController::userConsentsToCookies())
<!-- Load Analytics Script -->
<script>...</script>
@else
<!-- Load Anonymized Script or Nothing -->
@endif
Note: If APP_COOKIE_CONSENT is set to false, the system assumes consent is granted by default (or not required), and userConsentsToCookies() returns true.
Updating Your Privacy Policy
The consent banner links to your Privacy Policy. You should ensure this policy accurately reflects your data usage.
To edit the policy:
- Navigate to
lang/<locale>/md/ - Open
privacy.md - Update the content to match your legal requirements