# Cookie opt-in mode and EU cookie law

**URL:** <https://community.dynatrace.com/t/cookie-opt-in-mode-and-eu-cookie-law/20334>\
**Category:** Real User Monitoring\
**Tags:** real-user-monitoring-classic, data-privacy\
**Created:** [September 21, 2020, 11:07am UTC](https://community.dynatrace.com/t/cookie-opt-in-mode-and-eu-cookie-law/20334 "2020-09-21T11:07:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pete\_lindsell](https://avatars.discourse-cdn.com/v4/letter/p/977dab/32.png) [@pete\_lindsell](https://community.dynatrace.com/u/pete_lindsell)\
**Post date:** [September 21, 2020, 11:07am UTC](https://community.dynatrace.com/t/cookie-opt-in-mode-and-eu-cookie-law/20334/1 "2020-09-21T11:07:22Z")

</div>

Hi,

I am implementing a cookie banner to comply with the EU Cookie Law.

Reading the dynatrace documentation I thought that enabling cookie opt-in mode would stop Dynatrace setting any cookies until dtrum.enable() is called.

This appeared to be the case, if I cleared the cookies and refreshed the page the cookies were not set but if I cleared cookies and local storage and then refreshed the page the cookes were set.

Am I misunderstanding what cookie opt-in mode should prevent?

Thanks,

Pete

---

<div class="post-metadata">

**Author:** ![zietho](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/zietho/32/41733_2.png) [@zietho](https://community.dynatrace.com/u/zietho)\
**Post date:** [September 21, 2020, 12:50pm UTC](https://community.dynatrace.com/t/cookie-opt-in-mode-and-eu-cookie-law/20334/2 "2020-09-21T12:50:13Z")

</div>

Dear Peter,

after you first used dtrum.enable(), we keep a backup of the cookie in the local/session storage. To stop sending data with Dynatrace use **dtrum.disable().**

Find more here: [Configure data privacy settings for web applications in RUM Classic — Dynatrace Docs](https://www.dynatrace.com/support/help/shortlink/configure-rum-privacy#opt-in-mode)

kind regards

Thomas

---

<div class="post-metadata">

**Author:** ![pete\_lindsell](https://avatars.discourse-cdn.com/v4/letter/p/977dab/32.png) [@pete\_lindsell](https://community.dynatrace.com/u/pete_lindsell)\
**Post date:** [September 21, 2020, 3:53pm UTC](https://community.dynatrace.com/t/cookie-opt-in-mode-and-eu-cookie-law/20334/3 "2020-09-21T15:53:52Z")

</div>

Hi Thomas,

Thanks very much for the response. My problem is that the cookies are being set before I call dtrum.enable() on a browser with no previous cookie, local storage, session storage.

Thanks,

Pete

---

<div class="post-metadata">

**Author:** ![zietho](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/zietho/32/41733_2.png) [@zietho](https://community.dynatrace.com/u/zietho)\
**Post date:** [September 22, 2020, 7:50am UTC](https://community.dynatrace.com/t/cookie-opt-in-mode-and-eu-cookie-law/20334/4 "2020-09-22T07:50:26Z")

</div>

That’s odd! Then I’d suggest you please open a support ticket with us such that we can have a look at this!

Thanks in advance!
