When you run your online business in California and share collected visitor data with third parties in exchange for something of value, you need to add a link reading “Do not sell my personal information” to your website. The link should lead to the page where a visitor can opt out of data sharing.
This rule is a part of guidelines from California Consumer Privacy Act (aka CCPA), and before you apply it, your legal team should assess if you “sell” collected data. If you do, then you can use the following method to add a bottom bar with a link and an opt-out mechanism to your site.
Here’s an example of the bottom bar that a visitor will see after entering the website.

And here’s an example of an opt-out form where a visitor will be able to opt out of tracking or sharing his data.

Before you start
Here are some things to know before you start setting up both elements:
- You’ll use an opt-out mechanism available in Piwik PRO to allow visitors opt out of tracking, and as a result opt out of sharing their data. Optionally, you can set up the mechanism to collect visitor data but not to fire a tag that shares data with third parties.
- You’ll use a custom code that will show a bottom bar on your website with a “Do not sell my personal information” link. Optionally, you can add a plain link to the footer menu.
- Because you want to show the link to visitors from California, you’ll need to create an audience in Audience Manager, which you’ll then use in a trigger in Tag Manager
Add an opt-out form to your page
We’ll start with adding an opt-out form to the privacy policy page. The form will allow visitors to opt out of tracking and as a result opt out of sharing their data.
To add an opt-out form to your site, follow these steps:
Available from version 16.0.0. For versions below 16.0.0, go to Menu > Administration > Platform > Opt-out generator.
- Go to Menu > Administration.
- Navigate to Settings.
- On the left, click Opt-out form.
- Type the message you want to show to your visitors.
- Click Preview to see how the message will sound once installed on your website. The message will inherit your website’s CSS styles so it will look different from this preview.
- When you’re happy with how the form looks, copy the code and paste it on your page.
- Now the opt-out form is on your page. To make sure it’s ready to use, you need to check if tags have turned on the following option: Respect opt-out and DNT.
- Go to Menu > Tag Manager.
- Navigate to Tags.
- On the left, click Piwik PRO.
- In Privacy, turn on Respect opt-out and DNT.
Note: If turned on, this tag won’t fire for visitors who opt out of tracking. Make sure it’s turned on for all tags that you use to collect and share data.
- Click Save for the tag.
- Check other tags.
Note: Make sure that Respect opt-out and DNT is turned on for each tag connected to third-party tools that profit off of user data, for example, Google Ads, Facebook Ads, data management platforms, and other ad platforms. Also, some free services that you use on your website, like social share buttons, may monetize data from sites where they are embedded.
- You can also use debug mode to check how tags behave for opted-out visitors. In the top-right corner click Debug.
- Your website will open in a new tab with debug mode running.
- Toggle Simulate opt-out.
- You’ll see a note
Opted out
for each tag that has Respect opt-out and DNT turned on.
- Optionally, you can set up the whole mechanism to collect data, but not to fire tags that are responsible for sharing data with third parties. In that case, you can communicate to visitors, that they opt out of sharing data, but not of tracking.
- When you’re happy with how the tags work, click Publish.
Create an audience of California users
Now, you’ll need to create an audience of visitors from California to later use it in a trigger in Tag Manager.
To create an audience of California users, follow these steps:
- Go to Menu > Audience Manager.
- Click Add new audience.
- Name the audience.
- Choose the following attribute:
Region
. Drag and drop it from the right-hand menu to the left-hand drop point.
- Set the following condition for an attribute:
Region is California (United States)
.
- When you’re done, click Save.
Create a tag with a custom code
As the last step, we’ll create a tag with a custom code that will show a bottom bar with a link reading “Do not sell my personal information.” The link will lead to the privacy policy page, preferably to the section with the opt-out form.
Here’s the code that you’ll use:
<style>
#ppms_ccpa__bottom_bar {
z-index: 100000000 !important;
background-color: #fff !important;
position: fixed;
bottom: 0;
left: 0;
width: 100%;
box-shadow: 0 -2px 5px 1px rgba(0, 0, 0, .14) !important
}
#ppms_ccpa__bottom_bar .ppms_ccpa__wrapper {
padding: 18px
}
#ppms_ccpa__bottom_bar a {
text-decoration: none;
font-size: 14px;
font-family: BlinkMacSystemFont, -apple-system, Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important
}
#ppms_ccpa__bottom_bar .ppms_ccpa__close:after {
display: inline-block;
content: '\2716';
font-size: 13px;
float: right;
margin-top: -16px
}
#ppms_ccpa__bottom_bar .ppms_ccpa_wrapper_footer {
border-top: 1px solid #ddd;
padding: 11px;
text-align: right
}
#ppms_ccpa__bottom_bar .ppms_ccpa_wrapper_footer span {
color: #999;
font-size: 11px;
font-family: BlinkMacSystemFont, -apple-system, Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important
}
#ppms_ccpa__bottom_bar .ppms_ccpa_wrapper_footer .ppms_ccpa__logo {
height: 11px;
margin-left: 4px
}
</style>
<div id="ppms_ccpa__bottom_bar" style="display:none;">
<div class="ppms_ccpa__wrapper"><a href="/privacy-policy" id="ppms_ccpa__privacy-policy_link">Do not sell my personal information</a>
<div class="ppms_ccpa__close" style="cursor: pointer"></div>
</div>
<div class="ppms_ccpa_wrapper_footer"><span>Powered by <a href="https://piwik.pro/" target="_blank" id="ppms_ccpa__logo_link" rel="nofollow"><img class="ppms_ccpa__logo" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIiAgIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyIgICB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgICBpZD0ic3ZnMjAiICAgdmVyc2lvbj0iMS4xIiAgIHZpZXdCb3g9IjAgMCAyNzIuNDIgNDQuOTUiPiAgPG1ldGFkYXRhICAgICBpZD0ibWV0YWRhdGEyNiI+ICAgIDxyZGY6UkRGPiAgICAgIDxjYzpXb3JrICAgICAgICAgcmRmOmFib3V0PSIiPiAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9zdmcreG1sPC9kYzpmb3JtYXQ+ICAgICAgICA8ZGM6dHlwZSAgICAgICAgICAgcmRmOnJlc291cmNlPSJodHRwOi8vcHVybC5vcmcvZGMvZGNtaXR5cGUvU3RpbGxJbWFnZSIgLz4gICAgICA8L2NjOldvcms+ICAgIDwvcmRmOlJERj4gIDwvbWV0YWRhdGE+ICA8ZGVmc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M0gyMnYwQTE1LjkyLDE1LjkyLDAsMCwwLDM3LjI5LDE2Wm0tMTcsNi40N0gxMC42NFY5LjY3aDkuNDZhNi40LDYuNCwwLDAsMSwuMTksMTIuNzlaIiAvPiAgICA8L2c+ICA8L2c+PC9zdmc+" alt="Piwik PRO"></a></span></div>
</div>
<script>
const ppms_ccpa__bottom_bar = document.querySelector("#ppms_ccpa__bottom_bar"),
ppms_ccpa__close = document.querySelector(".ppms_ccpa__close"),
ppms_ccpa__cookie = document.cookie.match(/ppms_ccpa__cookie/);
ppms_ccpa__bottom_bar && ppms_ccpa__close && (null === ppms_ccpa__cookie && ppms_ccpa__bottom_bar.setAttribute("style", "display: block;"), ppms_ccpa__close.addEventListener("click", function() {
document.cookie = "ppms_ccpa__cookie=1; path=/", ppms_ccpa__bottom_bar.remove()
}));
</script>
Note: This code links “Do not sell my personal information” to /privacy-policy
. So you may need to adjust it to your page. For example, you may add an anchor that links to the section with opt-out form /privacy-policy/#no-sale
. You can also modify <style> </style>
to fit your website’s design.
To add a custom code, follow these steps:
- Go to Menu > Tag Manager.
- Navigate to Tags.
- Click Add a tag.
- Name the tag and select the following type: Custom code (async).
- In Tag code, type your code.
- In Advanced tag settings, set the following type: No consent is required.
Note: Use this option to display the bottom bar for all visitors from California, whether they agreed or not to tracking using a consent form.
- Toggle Respect visitor privacy.
Note: When this option is turned on, the tag will not be fired for visitors who opt out of tracking. So in our case, if a visitor opts out using the opt-out form on the privacy policy page, he or she will not see the bottom bar again.
- In Tag triggers, click Add a trigger.
- Name the trigger.
- In Trigger type, choose the following trigger type: Page views.
- In Event conditions, set Returning visitor is false.
Note: Use this condition to display the bottom bar for first-time visitors.
- In Audiences, pick the audience that you’ve set:
California users
.
- Optionally, in Multiplicity, set the trigger to fire a tag once per session.
Note: Use this option to display the bottom bar one or many times per session.
- When you’re done, click OK.
- Click Save for the tag.
- Test your tag in debug mode.
- When you’re happy with how the tag works, click Publish.
- Now your bottom bar is ready to use.
Add a link to footer menu
Another way of setting up a “Do not sell my personal information” link is adding it to the footer menu.
To add a link to the footer menu, follow these steps:
- Create an anchor for the section with an opt-out form on your privacy policy page. For example,
/privacy-policy/#no-sale
. - Add the link to the footer menu.