How to tag your JavaScript scripts.
Adjust your JavaScript scripts
The CCPA treats serving personalized ads as a possible "sale" of personal information. CCPA Opt-out by TermsFeed lets your website visitors opt out of the personalized ads you serve through third-party JavaScript scripts, such as Google Ads.
It's still up to you to respect the choices users make, and to give them an opt-out, as the CCPA defines it, for anything that counts as a "sale" of personal information.
Example
Take the Google Analytics code as an example. CCPA Opt-out by TermsFeed loads the Google Analytics tracking code for a user who has not opted out, and skips it for a user who has opted out.
To do that, follow these steps.
-
Organize your different JavaScript scripts into separate
<script>elements. -
For any
<script>element you want to toggle through the CCPA Opt-out tool, change thetype="text/javascript"parameter totype="text/plain". -
Then, add a
ccpa-opt-out="personalized-ads"attribute to each script.
<!-- Google Tracking Code -->
<script type="text/plain" ccpa-opt-out="personalized-ads">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', /* Google Property ID */, 'auto');
ga('send', 'pageview');
</script>