Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Varbase FAQs 9.2.1 Minor update available for module varbase_faqs (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

This module integrates with cookie consent management to control Microsoft Dynamics 365 Marketing form tracking. It adds JavaScript snippets to either anonymize user data for Dynamics 365 forms when consent is not given, or enable full tracking when consent is provided.

This module is very specific and work in progress. Do NOT use in production!

Provides anonymize callbacks for Dynamics 365 Forms with COOKiES Consent Management Cookie Banner as described in How to disable non-essential Dynamics 365 Marketing cookies:

This module does not add, handle or block any MS Dynamics 365 Form Code snippets. Neither it blocks the MS Dynamics 365 Marketing Scripts or Forms or Cookies. Its only focus is to set / remove the "anonymize" flag as documented.

Functionality

This module neither adds the MS Dynamics 365 Marketing Forms code to the project,
nor it provides functionality to handle the codes.

It simply adds the "anonymize: true" / "anonymize: false" flag JS Snippet from
https://docs.microsoft.com/en-us/dynamics365/marketing/cookies#how-to-disable-non-essential-dynamics-365-marketing-cookies
based on the consent decision.

  • If conset IS NOT given (default), it adds "anonymize: true".
  • If consent IS given, it adds "anonymize: false".

Technically spoken:

If consent is not given, places

<script>
    function d365mktConfigureTracking() {
         return {Anonymize: true};
    }
</script>

globally.

If consent is given, calls

MsCrmMkt.reconfigureTracking({Anonymize: false})

How to use

  • Enable and configure COOKiES module and this module.
  • Add the MS Dynamics 365 Marketing Forms to your page like before.
  • Ensure the anonymization is added to every page and is working as expected!

How to test

Call d365mktConfigureTracking(); in your browser console with and without cookie consent to check if anonymize: "true" or "false" is returned. If the function is not defined, something is broken.

Activity

Total releases
1
First release
Jul 2025
Latest release
11 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Slowing

Releases

Version Type Release date
1.0.0-alpha2 Pre-release Jul 28, 2025