This module helps stores comply with GDPR by anonymizing customer data. It allows for manual anonymization of user accounts, along with their associated orders and profiles, and can also automatically anonymize inactive accounts after a specified period.
Provides GDPR compliance tools for Drupal Commerce.
Commerce GDPR Anonymize
Commerce GDPR helps Drupal Commerce sites comply with GDPR Art. 17 (right to be forgotten) by anonymizing personal data on users, profiles, and orders instead of deleting records that may still be needed for accounting or reporting.
Personal values are hashed or cleared and prefixed with commerce_gdpr--. Address fields keep the country code while other address properties are anonymized. User accounts are blocked after anonymization, and already-anonymized entities are skipped.
Site administrators can anonymize a single order or user from confirmation forms, or process many at once with bulk actions. Optionally, cron can queue eligible completed orders after a configurable retention period, skipping customers with excluded roles. Third-party modules can alter which fields are anonymized and react after a profile, user, or order has been anonymized through module hooks..
Requirements
This module requires the following modules:
- Commerce Order
- Profile
- User (Drupal core)
Installation
Install as you would normally install a contributed Drupal module. For further information, see Installing Drupal Modules.
Configuration
- Enable the module at Administration > Extend.
- Configure retention and excluded roles at Administration > Commerce > Configuration > Commerce GDPR (
/admin/commerce/config/commerce-gdpr). - Optionally set a dedicated salt and hash algorithm in
settings.phpfor stronger anonymization (default for the salt is the "hash_salt" set in the settings.php and "md5" for the algorithm used):
$settings['commerce_gdpr_salt'] = 'your-unique-salt-at-least-22-chars';
$settings['commerce_gdpr_algo'] = 'sha256';
Extending
Third-party modules can integrate with Commerce GDPR Anonymize through hooks documented in commerce_gdpr_anonymize.api.php.
-
hook_commerce_gdpr_anonymize_fields_alter()Alter the field anonymization map for an entity type and bundle. Each field entry supports keys such asanonymizationType(hash,hash_email,clear,value,address),max_length, and optionallyvalue. -
hook_commerce_gdpr_profile_anonymized()React after a customer profile has been anonymized. -
hook_commerce_gdpr_user_anonymized()React after a user account has been anonymized. -
hook_commerce_gdpr_order_anonymized()React after an order has been anonymized.
Use the alter hook to add or change which fields are anonymized; use the *_anonymized hooks to clean up related custom data stored outside Commerce entities.
Alternative modules
Other contributed modules that address similar GDPR anonymization needs:
- General Data Protection Regulation (GDPR) Broader GDPR toolkit with checklists, consent tracking, and the GDPR Tasks submodule for user-initiated forget-me and data-export requests. This module is NOT affiliated with commerce_gdpr because we decided to keep things simpler here.
- User Field Anonymize Lets users anonymize their own profile fields, with access restricted by role.
- Configurable Anonymizer Configurable, field-level anonymization via Drush for development and staging environments.
Complementary modules
Modules that complement Commerce GDPR for a more complete privacy setup:
- IP Anonymize Scrub stored IP addresses on a configurable retention schedule (cron).
- Klaro - Full-featured Consent Management solution for external sources and cookies.
Supporting this module
Support DROWL's ♥ FOSS work on this module on OpenCollective!
Drupal and this module are FOSS. However, it takes dedicated people to develop and maintain. And they need YOU to give back!
We're committed to building and maintaining Drupal modules that benefit the entire community.
Supporting us on OpenCollective helps us continue to improve, innovate and contribute to Drupal's future. Every pledge makes a difference!
If this module has helped you, we would be very grateful for your donation to support its further development and maintenance.
Support our FOSS development ♥️
You can also speed up the development of features or bugfixes you'd love to see, by sponsoring and giving back!
Let's make Drupal even better, together!
Development on 3.x proudly sponsored by German Drupal Friends & Companies:
webks: websolutions kept simple (https://www.webks.de)
and
DROWL: Drupalbasierte Lösungen aus Ostwestfalen-Lippe (OWL), Germany (https://www.drowl.de)