How to add the “Do not sell my personal information” bar

Necessary tools: Tag Manager + Audience Manager

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.

A "Do not sell my personal information" link on a bottom bar by Piwik PRO.

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.

An opt-out form for CCPA by Piwik PRO.

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:

  1. Go to Menu > Administration.
  2. Navigate to Platform.
  3. On the left, click Opt-out generator.
  4. Type the message you want to show to your visitors.
  5. Message on an opt-out form for CCPA by Piwik PRO.
  6. 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.
  7. Message on an opt-out form for CCPA by Piwik PRO.
  8. When you’re happy with how the form looks, copy the code and paste it on your page.
  9. An opt-out form for CCPA by Piwik PRO.
  10. 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 visitor privacy.
  11. An opt-out form for CCPA by Piwik PRO.
  12. Go to Menu > Tag Manager.
  13. Navigate to Tags.
  14. On the left, click Piwik PRO tag.
  15. In Advanced tag settings, toggle Respect visitor privacy.
  16. Setting a tag for an opt-out form for CCPA by Piwik PRO.

    Note: When this option is turned on, the tag will not be fired for visitors who opted out. So when you use an opt-out mechanism, all your tags responsible for collecting and sharing data should have this option enabled. This option is turned on by default, but make sure that it hasn’t been changed in the meantime.

  17. Click Save for the tag.
  18. Check other tags.
  19. Note: Make sure that Respect visitor privacy 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.

  20. You can also use debug mode to check how tags behave for opted-out visitors. In the top-right corner click Debug.
  21. Your website will open in a new tab with debug mode running.
  22. Debug mode in Piwik PRO.
  23. Toggle Simulate opt-out.
  24. Simulate opt-out in debug mode in Piwik PRO.
  25. You’ll see a note Opted out for each tag that has Respect visitor privacy turned on.
  26. Simulate opt-out in debug mode in Piwik PRO.
  27. 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.
  28. 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:

  1. Go to Menu > Audience Manager.
  2. Click Add new audience.
  3. Name the audience.
  4. Choose the following attribute: Region. Drag and drop it from the right-hand menu to the left-hand drop point.
  5. Audience in Audience Manager in Piwik PRO.
  6. Set the following condition for an attribute: Region is California (United States).
  7. Audience in Audience Manager in Piwik PRO.
  8. 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+PHN2ZyAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIiAgIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyIgICB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgICBpZD0ic3ZnMjAiICAgdmVyc2lvbj0iMS4xIiAgIHZpZXdCb3g9IjAgMCAyNzIuNDIgNDQuO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2E1LjMyLDUuMzIsMCwxLDAsMTAuNjQsMFY1LjM0YTUuMzIsNS4zMiwwLDEsMC0xMC42NCwwWiIgLz4gICAgICA8cGF0aCAgICAgICAgIGlkPSJwYXRoMTYiICAgICAgICAgc3R5bGU9ImZpbGw6IzEzMTMxMyIgICAgICAgICBkPSJNMzcuMjksMTZBMTUuOTIsMTUuOTIsMCwwLDAsMjIsLjA5djBINS4zMkE1LjI4LDUuMjgsMCwwLDAsMCw1LjM4VjM5LjU2YTUuMjgsNS4yOCwwLDAsMCw1LjMyLDUuMzIsNS4yOCw1LjI4LDAsMCwwLDUuMzItNS4zMlYzMS45M0gyMnYwQTE1LjkyLDE1LjkyLDAsMCwwLDM3LjI5LDE2Wm0tMTcsNi40N0gxMC42NFY5LjY3aDkuNDZhNi40LDYuNCwwLDAsMSwuMTksMTIuNzlaIiAvPiAgICA8L2c+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:

  1. Go to Menu > Tag Manager.
  2. Navigate to Tags.
  3. Click + Create new tag.
  4. Name the tag and select the Custom asynchronous tag template.
  5. In Tag HTML code, type your code.
  6. A tag with a custom code in Piwik PRO.
  7. In Advanced tag settings, set the following type: Does not require consent.
  8. A tag with a custom code in Piwik PRO.

    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.

  9. Toggle Respect visitor privacy.
  10. A tag with a custom code in Piwik PRO.

    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.

  11. In Tag triggers, click + New trigger.
  12. Name the trigger.
  13. In Event type, choose the following trigger type: Page views.
  14. A trigger for a tag with a custom code in Piwik PRO.
  15. In Trigger conditions, set the following condition: Returning visitor is false.
  16. A trigger for a tag with a custom code in Piwik PRO.

    Note: Use this condition to display the bottom bar for first-time visitors.

  17. In Audiences, pick the audience that you’ve set: California users.
  18. A trigger for a tag with a custom code in Piwik PRO.
  19. Optionally, in Multiplicity, set the trigger to fire a tag once per session.
  20. A trigger for a tag with a custom code in Piwik PRO.

    Note: Use this option to display the bottom bar one or many times per session.

  21. When you’re done, click Save for the trigger and click Save for the tag.
  22. Test your tag in debug mode.
  23. When you’re happy how the tag works, click Publish.
  24. Now your bottom bar is ready to use.
A "Do not sell my personal information" link on a bottom bar by Piwik PRO.

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:

  1. Create an anchor for the section with an opt-out form on your privacy policy page. For example, /privacy-policy/#no-sale.
  2. Add the link to the footer menu.
A "Do not sell my personal information" link in a footer menu.
Was this article helpful?

Be the first to rate this article.

Technical Support

If you have any questions, drop us a line at support_SPC@piwik_SPC.pro.

We’re happy to help!