Pen Settings



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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


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


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.


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.


                <!doctype html>
    <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 src="//"></script>
    <script type="text/javascript" src="//" charset="UTF-8" async></script>

      <div class="wrapper">
        <h1>iubenda Cookie Solution for CCPA</h1>
        <p>Non-EU business that operates in California but not in the EU</p>
    <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="" />
      <p>As you can see from the Cookie Solution snippet, we've set:</p>
        <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>
      <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="" />

          <li><code>enableCcpa: true</code></li>
          <li><code>gdprAppliesGlobally: false</code></li>
          <li><code>countryDetection: true</code></li>                 </ul>     
      <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">
          <li>Remember to use your own credentials from <a href="" 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>
      <!--hr /-->
      <h4>Helpful guides</h4>
      <ul class="guides">
        <li><a href="" target="_blank">CCPA Guide
        <li><a href="" target="_blank">CCPA: How to add a notice of collection and a "Do not sell" link</a></li>




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

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