Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!doctype html>
<html> 
  <head>
    <script type="text/javascript">
        var _iub = _iub || [];
        _iub.csConfiguration = {
            "lang": "en",
            "siteId": 896537, //use your siteId
            "cookiePolicyId": 8207462, //use your cookiePolicyId
            "consentOnScroll": false, //avoid consent to be given when the user scrolls the page
            "enableCcpa": true,
            "ccpaApplies": true,
            "enableGdpr": false,
            "gdprApplies": false,
            "gdprAppliesGlobally": false,
            "banner": {
                "position": "float-top-center"
            }
        };
    </script>
    <script src="//cdn.iubenda.com/cs/ccpa/stub.js"></script>
    <script type="text/javascript" src="//cdn.iubenda.com/cs/iubenda_cs.js" charset="UTF-8" async></script>
  </head>

  <body>
    <header>
      <div class="wrapper">
        <h1>iubenda Cookie Solution for CCPA</h1>
        <p>Non-EU business that operates in California but not in the EU</p>
      </div>
    </header>
    
    <section class="wrapper">
      
      <p>In this demo for <strong>non-EU business that operates in California but not in the EU</strong>, we want to apply CCPA protections to all our users, but not apply the GDPR to any of them.</p> 
      
      <p>On the configurator, select "Apply CCPA" and "Always Apply CCPA":</p>
      
      <img src="https://help.iubenda.com/wp-content/uploads/2019/12/cookie-solution-ccpa-all-users.png" />
      
      <p>As you can see from the Cookie Solution snippet, we've set:</p>
      
      <ul>
        <li><code>enableCcpa: true</code></li>
        <li><code>ccpaApplies: true</code></li>               
        <li><code>enableGdpr: false</code></li>
        <li><code>gdprApplies: false</code></li>
        <li><code>gdprAppliesGlobally: false</code></li>
      </ul>      
      
      <div class="tip">
        <p>If you want the CCPA to <strong>only</strong> apply to Californian users, select "Apply CCPA" and "Automatically detect when to apply CCPA based on user location":</p>
        
        <img src="https://help.iubenda.com/wp-content/uploads/2019/12/cookie-solution-ccpa-californian-users.png" />

        <p>Code:</p>
        
        <ul>
          <li><code>enableCcpa: true</code></li>
          <li><code>gdprAppliesGlobally: false</code></li>
          <li><code>countryDetection: true</code></li>                 </ul>     
      </div>
      
      <h4>"Do Not Sell My Personal Information" link</h4>
      
      <p>In order to show a "Do Not Sell My Personal Information" link on your website (in addition to the one included in the banner), just add the <code>iubenda-ccpa-opt-out</code> class to a custom link or button:</p>
      
      <p><a href="javascript:void(0)" class="iubenda-ccpa-opt-out">Do Not Sell My Personal Information</a></p>
      
      <p>This link will let you honor opt-out requests.</p>
      
      <div class="note">
        <ul>
          <li>Remember to use your own credentials from <a href="https://www.iubenda.com/en/dashboard" target="_blank">your iubenda account</a></li>
          <li>This is a sample for pure demonstrative purposes, <strong>no consents are saved</strong> (result of <code>_iub.csConfiguration.skipSaveConsent = true</code>). <a href="#" onclick="_iub.cs.cookie.resetCookies({local: true,remote: true});alert('Consent cookie deleted. Now click on OK and refresh the page to return to the starting point.')">Reset consent</a> and refresh the page to return to the starting point.</li>
        </ul>
      </div>
      
      <!--hr /-->
      
      <h4>Helpful guides</h4>
      <ul class="guides">
        <li><a href="https://www.iubenda.com/en/help/19133" target="_blank">CCPA Guide
</a></li> 
        <li><a href="https://www.iubenda.com/en/help/21165" target="_blank">CCPA: How to add a notice of collection and a "Do not sell" link</a></li>
      </ul>
      
    </section>
  </body>
</html>
              
            
!

CSS

              
                
              
            
!

JS

              
                //don't copy this JS (just for demo purposes)

//don't save consent, always show the banner
_iub.csConfiguration.skipSaveConsent = true; 
              
            
!
999px

Console