# How to implement opt-out

**URL:** <https://forums.realmacsoftware.com/t/how-to-implement-opt-out/15545>\
**Category:** RapidWeaver Classic\
**Tags:** cookie\
**Created:** [August 3, 2017, 10:06am UTC](https://forums.realmacsoftware.com/t/how-to-implement-opt-out/15545 "2017-08-03T10:06:45Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![sagaz](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@sagaz](https://forums.realmacsoftware.com/u/sagaz)\
**Post date:** [August 3, 2017, 10:06am UTC](https://forums.realmacsoftware.com/t/how-to-implement-opt-out/15545/1 "2017-08-03T10:06:45Z")

</div>

Hi,

I’m German and I have to provide opt-out functionality in my Website and don’t know how to do it.

What I’ve done already (Rapid Weaver 6):

1. I’ve put my Google Analytics Code in the section “Stats”
2. I’ve my opt-out script ready - but don’t no where to put it
3. I’ve the following Link for execution: Click here to opt-out of Google Analytics and don’t know how to connect it with my opt-out script

Do I have the possibility to test it as long as the site is not published?

Any help is highly appreciated.  
Thank’s in advance!

---

<div class="post-metadata">

**Author:** ![swilliam](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/swilliam/32/14799_2.png) [@swilliam](https://forums.realmacsoftware.com/u/swilliam)\
**Post date:** [August 3, 2017, 7:11pm UTC](https://forums.realmacsoftware.com/t/how-to-implement-opt-out/15545/2 "2017-08-03T19:11:35Z")

</div>

Some info:

> **[How to create an Opt-Out link for Google Analytics](https://webgilde.com/en/analytics-opt-out/)**
>
> Did you know that you must offer a link to opt out from Analytics tracking on your site? Here you are going to learn how to implement such a link.

the script will probably work if you put it in the JavaScript area (site wide or page depending on what you are after).  
Remove the tags RW inserts them for you.

According to this article, it should also work in the Head area (keep the tags).

---

<div class="post-metadata">

**Author:** ![sagaz](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@sagaz](https://forums.realmacsoftware.com/u/sagaz)\
**Post date:** [August 4, 2017, 9:15am UTC](https://forums.realmacsoftware.com/t/how-to-implement-opt-out/15545/3 "2017-08-04T09:15:36Z")

</div>

Thank’s a lot!  
I put the script in the Head-area and checking the html-code, RW puts it on the right spot before the “Google Analytics Script”. I used “Ignore Formatting” and it also worked. But I don’t get a cookie when clicking the Link…

---

<div class="post-metadata">

**Author:** ![swilliam](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/swilliam/32/14799_2.png) [@swilliam](https://forums.realmacsoftware.com/u/swilliam)\
**Post date:** [August 4, 2017, 6:36pm UTC](https://forums.realmacsoftware.com/t/how-to-implement-opt-out/15545/4 "2017-08-04T18:36:13Z")

</div>

what is the page url with the script?

---

<div class="post-metadata">

**Author:** ![sagaz](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@sagaz](https://forums.realmacsoftware.com/u/sagaz)\
**Post date:** [August 4, 2017, 6:50pm UTC](https://forums.realmacsoftware.com/t/how-to-implement-opt-out/15545/5 "2017-08-04T18:50:45Z")

</div>

[http://roomtwist.de/roomtest/styled-7/](http://roomtwist.de/roomtest/styled-7/)

Thanks! 😄

---

<div class="post-metadata">

**Author:** ![swilliam](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/swilliam/32/14799_2.png) [@swilliam](https://forums.realmacsoftware.com/u/swilliam)\
**Post date:** [August 4, 2017, 8:25pm UTC](https://forums.realmacsoftware.com/t/how-to-implement-opt-out/15545/6 "2017-08-04T20:25:41Z")

</div>

humm, looks right. I’m afraid I don’t know why it wouldn’t work.  
maybe one of the JS guys can chime in maybe @teefers Doug will have an answer.

---

<div class="post-metadata">

**Author:** ![teefers](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/teefers/32/8173_2.png) [@teefers](https://forums.realmacsoftware.com/u/teefers)\
**Post date:** [August 4, 2017, 8:54pm UTC](https://forums.realmacsoftware.com/t/how-to-implement-opt-out/15545/7 "2017-08-04T20:54:23Z")

</div>

Looks like you are setting the cookie:  
Before:

 ![2017-08-04_13-48-48](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/2X/0/0448fbf247fd75c39d839f7e1d1c5d4038e1721f.png)

After I clicked the opt out text:

 ![2017-08-04_13-50-17](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/2X/7/707b8a4d363539decb1da0df432d7007b562982d.png)

And it is still there when I navigate to your home page:

 ![2017-08-04_13-53-25](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/2X/8/82d4d1940e6a632db9d2edf0c6de399a33f5ddc9.png)

---

<div class="post-metadata">

**Author:** ![teefers](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/teefers/32/8173_2.png) [@teefers](https://forums.realmacsoftware.com/u/teefers)\
**Post date:** [August 4, 2017, 10:21pm UTC](https://forums.realmacsoftware.com/t/how-to-implement-opt-out/15545/8 "2017-08-04T22:21:33Z")

</div>

Did want to point out that when you set a cookie that way in Javascript, you do need to refresh the page or leave and come back to see the cookie in the browser. The cookie is placed but the browser will not show it.

---

<div class="post-metadata">

**Author:** ![sagaz](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@sagaz](https://forums.realmacsoftware.com/u/sagaz)\
**Post date:** [August 7, 2017, 11:36am UTC](https://forums.realmacsoftware.com/t/how-to-implement-opt-out/15545/9 "2017-08-07T11:36:44Z")

</div>

Hi, thank’s a lot - it’s getting clearer! Working with RapidWeaver 6 I can’t edit the html code. But I’ve two sections where to put the script: first I tried the _Head-Section_ with the effect you described. Now I tried the _Javascript-Section_ but still cant find any cookie. Any idea where to put the script so it works as it should? (There are also sections called CSS and Prefex - but I can’t imagine it’s one of these).

---

<div class="post-metadata">

**Author:** ![swilliam](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/swilliam/32/14799_2.png) [@swilliam](https://forums.realmacsoftware.com/u/swilliam)\
**Post date:** [August 7, 2017, 1:31pm UTC](https://forums.realmacsoftware.com/t/how-to-implement-opt-out/15545/10 "2017-08-07T13:31:08Z")

</div>

Sophie, Doug is showing you that it is working as is
