How to implement opt-out


(Sophie Braga) #1

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!


(scott williams) #2

Some info:

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).


(Sophie Braga) #3

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…


(scott williams) #4

what is the page url with the script?


(Sophie Braga) #5

http://roomtwist.de/roomtest/styled-7/

Thanks! :smile:


(scott williams) #6

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.


(Doug Bennett) #7

Looks like you are setting the cookie:
Before:

After I clicked the opt out text:

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


(Doug Bennett) #8

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.


(Sophie Braga) #9

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).


(scott williams) #10

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