Download the PHP package generoi/genero-cmp without Composer
On this page you can find all versions of the php package generoi/genero-cmp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download generoi/genero-cmp
More information about generoi/genero-cmp
Files in generoi/genero-cmp
Package genero-cmp
Short Description CMP Plugin
License MIT
Homepage https://github.com/generoi/genero-cmp
Informations about the package genero-cmp
genero-cmp
CMP Plugin
Features
- YouTube block use
youtube-noockie.com
domain instead - YouTube and Google Maps iframes require marketing and statistics consent before shown.
- Event Tracking for Gravity Forms container code is removed.
- Gravity Forms Analytics analytics tag is removed.
- CTX Feed pixel is removed.
- WP Consent API integration (required for GDPR compliant WooCommerce).
- TikTok for Business pixel is removed until marketing consent has been given
- Facebook for WooCommerce pixel gets
fbq('consent', 'revoke');
when initialized
Block consent settings (beta)
Blocks in the block editor are extended with an option to either hide/show based on one or multiple consents.
Note this is likely broken in some cases at the moment.
PHP API
Define necessary cookies
When withdrawing consent, all non-necessary cookies are removed. You can edit this set of cookies.
Alter consent categories
You can add or remove custom consent categories.
Block additional iframe embeds
By default iframes in the_content
referencing youtube.com get blocked using <gds-cmp-consent consent="marketing">
. You can extend this to other iframe matches or all of them.
JavaScript API
Events
Utilities
Hide content using CSS
Control cookie consent dialog
Add .js-gds-cmp-show
class to any element (needs to be in DOM before DOMDocumentReady).
Add [data-gds-cmp-trigger="show|hide|withdraw"]
selector to any element (delegates as a document click listener)
- Run manually with
window.gdsCmp.show()
- Run
show()
on the<gds-cmp-modal-dialog>
element
Block elements from being loaded using [data-gds-cmp-consent]
attribute
You can add data-gds-cmp-consent="marketing preferences"
to an element and once consent has been given, the element will evaluate.
Supported elements are <script>
, <img>
, <video>
and <iframe>
.
This is useful if content is entirely opt-in and doesnt require prompting the user for consent.
Block elements with a message using <gds-cmp-embed>
You can also use as=""
attribute to replace eg an <iframe>
.
If you need to run JS once the embed replace has taken place, you can listen for the gds-cmp-embed.replaced
event.
GTM events
Whenever users change consent the gds-cmp.update
event will be sent to gtag. By creating a trigger for this event and adding it together with the Consent initialization trigger, tags will run on the first page load after consent is updated.
Development
Install dependencies
composer install
npm install
Run the tests
npm run test
Build assets
# Minified assets which are to be committed to git
npm run build:production
# Watch for changes and re-compile while developing the plugin
npm run start
Translations
wp i18n make-pot . languages/genero-cmp.pot
wp i18n make-mo languages/