Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pubCommonId optout example #1068

Merged
merged 1 commit into from
Dec 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dev-docs/modules/pubCommonId.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@ Example: Changing ID expiration to 1 year

### User Opt-Out

Individual user opt-out is supported by setting the `_pubcid_optout` cookie in the publisher's domain. When this cookie is set, then Publisher Common ID is neither read nor updated, and it will not be made available to any adapters.
Users must be allowed to opt out of targeted advertising. When implementing this module, you are required to place a link in your privacy policy or elsewhere on your website which allows the user to implement this opt-out. User opt-out is supported by setting the `_pubcid_optout` cookie in the publishers domain. When this cookie is set, then Publisher Common ID is neither read nor updated, and it will not be made available to any adapters. The opt-out must also delete the Publisher Common ID cookie (shown in [example](../../examples/modules/pub_common_id_optout.html)).

* Opt-In - `_pubcid_output` cookie is not present or set to 0
* Opt-Out - `_pubcid_output` cookie is set to 1


### Build the package

#### Step 1: Bundle the module code
Expand Down
36 changes: 36 additions & 0 deletions examples/modules/pub_common_id_optout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.0/jquery-confirm.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.0/jquery-confirm.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#fpcsettings").click(function() { showDialog();});
});

function setCookie(name, value, days) {
var d = new Date;
d.setTime(d.getTime() + 24*60*60*1000*days); document.cookie = name + "=" + value + ";path=/;expires=" + d.toGMTString();
}

function deleteCookie (name){ setCookie(name, '', -1); }

function showDialog(){
$.confirm({
title: 'Publisher Common ID Opt Out', content: 'Publisher Common ID Opt Out', cancelButton: 'Opt Out',
buttons: {
optin:{
text: 'Opt Out',
action: function(){
setCookie('_pubcid_optout', '1', 1825);
deleteCookie('_pubcid'); }
}}
});
}
</script>
</head>
<body>
To control Publisher Common ID settings <a id="fpcsettings">click here</a>.
</body>
</html>