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,
            "gdprAppliesGlobally": false, //true if you're EU-based
            "countryDetection": true,
            "banner": {
                "position": "float-top-center",
                "acceptButtonDisplay": true,
                "customizeButtonDisplay": true,
                "rejectButtonDisplay": true //show reject button
    <script src="//"></script>
    <script type="text/javascript" src="//" charset="UTF-8" async></script> <!-- onload=" = 'EU';" to force EU (for testing purposes) -->

      <div class="wrapper">
        <h1>iubenda Cookie Solution for CCPA</h1>
        <p>Business that operates both in the EU and in California</p>
    <section class="wrapper">
      <p>In this demo for <strong>non-EU businesses that operate both in the EU and in California</strong> we want to apply CCPA to Californian users and GDPR to EU users.</p> 
      <p>On the configurator, select "Apply both" and "Automatically detect when to apply CCPA based on user location":</p>

      <img src="" />
      <p>Then, <strong>if you're not EU-based</strong>, click on "Advanced View" and select "Request consent to EU users only":</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>gdprAppliesGlobally: false</code> (<code>true</code> if you're EU-based)</li>
        <li><code>countryDetection: true</code></li>
      <p>We'll apply the CCPA when we detect that the user is connecting from California and the GDPR when the user is connecting from the EU.</p>
      <div class="tip">
        <p>If you're a <strong>EU business that operates also in California</strong>, you have to <strong>apply GDPR worldwide</strong> by setting <code>gdprAppliesGlobally: true</code>.</p>
      <p>💡 If you're based in the US and you want to mimic the behaviour of the banner for EU users, you can override country detection and force EU by adding <code>onload=" = 'EU';"</code> to the iubenda_cs.js script.</p>
      <hr />
      <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;