=== Fidelisimo Cookie Notice ===
Contributors: fidelisimo
Tags: cookies, gdpr, cookie consent, cookie banner, google analytics
Requires at least: 6.3
Requires PHP: 7.4
Tested up to: 7.1
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Cookie consent banner that blocks Google Analytics until the visitor gives consent.

== Description ==

A WordPress plugin that integrates a cookie consent banner and blocks Google Analytics scripts until the user accepts cookies.

This plugin integrates the "Cookie Consent" script developed by Orest Bida, available at https://cookieconsent.orestbida.com/. It is a robust and easy-to-use solution for managing cookie consent on websites, ensuring compliance with relevant privacy regulations.

The library is distributed under the MIT license and is included in the plugin, so it is not loaded from any external CDN.

**Google Analytics Integration**

This plugin includes Google Analytics functionality, a web analytics service provided by Google, Inc. ("Google"). Google Analytics uses "cookies", which are text files placed on your computer, to help the website analyze how users use the site.

**Data Usage**

When using Google Analytics with our plugin, anonymous data about the use and behavior of visitors on your website is collected. This data may include information such as visit duration, pages visited, geographic location and the type of device used. No personally identifiable information is collected unless explicitly provided by the visitor.

**Legal Compliance and Privacy**

* Compliance with Google Policies: By using Google Analytics, you agree to be bound by Google's policies, including their privacy policy and terms of service.
* Transparency and Consent: It is recommended to inform users of your website about the use of Google Analytics and obtain their consent if required by law in your jurisdiction.

**More Information**

For more details about Google's privacy practices and how to configure or disable certain features, visit Google's Privacy Policy: https://policies.google.com/privacy

== External services ==

This plugin may load Google Analytics (gtag.js) from Google servers, and only does so if the administrator enters a measurement ID in the plugin settings.

* Service: Google Analytics (Google Ireland Limited / Google LLC).
* What is sent: the script is requested from https://www.googletagmanager.com/gtag/js with the configured measurement ID. Once loaded, Google receives visitor navigation data (visited URL, referrer, language, resolution, user agent and IP address, the latter anonymized via `anonymize_ip`).
* When it is sent: only after the visitor accepts the "analytics" category in the cookie banner. Until then, the script is printed inert and the browser does not download or execute it.
* Terms of service: https://policies.google.com/terms
* Privacy policy: https://policies.google.com/privacy

If no measurement ID is configured, the plugin does not make any requests to external services.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` or install it from the WordPress plugin browser.
2. Activate it from the Plugins menu.
3. Go to Settings > Cookie Notice Settings to configure the greeting, Google Analytics ID, menu where to add the preferences link, and privacy policy URL.

== Frequently Asked Questions ==

= How do I add a link to reopen cookie preferences? =

You can choose a menu in the plugin settings to automatically add the link, or insert the shortcode `[fidcn_cookie_center]` on any page or widget.

= Is Google Analytics loaded before accepting? =

No. The tag is printed with `type="text/plain"` and `data-category="analytics"`, so the browser does not download it. CookieConsent only reactivates it when the visitor accepts that category.

= Why doesn't Google Analytics load on my site? =

The attributes that make the tag inert are applied with filters that WordPress only passes to enqueued scripts since version 6.3. In earlier versions, the plugin omits Analytics completely to never load it without consent. If you have configured an ID and don't see any request to Google, update WordPress to 6.3 or higher.

== Screenshots ==

1. Cookie consent banner on the frontend. Google Analytics stays blocked until the visitor accepts.
2. Preferences modal to accept all, reject non-essential cookies, or save a custom choice.
3. Settings screen for the greeting, Google Analytics ID, menu link and privacy policy URL.

== Changelog ==

= 1.0.1 =

* Google Analytics is now loaded with wp_enqueue_script() and wp_add_inline_script(), and blocking attributes are applied with wp_script_attributes and wp_inline_script_attributes filters.
* Updated CookieConsent library to version 3.1.0 (UMD build).
* Fixed banner startup that was not initializing.
* Added sanitization callbacks to plugin settings.
* All texts are now translatable and the banner uses the site language.

= 1.0 =

* First official release
