Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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.


Auto Save

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>

    <!-- Google Tag Manager -->
        (function(w, d, s, l, i) {
            w[l] = w[l] || [];
                'gtm.start': new Date().getTime(),
                event: 'gtm.js'
            var f = d.getElementsByTagName(s)[0],
                j = d.createElement(s),
                dl = l != 'dataLayer' ? '&l=' + l : '';
            j.async = true;
            j.src =
                '' + i + dl;
            f.parentNode.insertBefore(j, f);
        })(window, document, 'script', 'dataLayer', 'GTM-KJ2TH74');
    <!-- End Google Tag Manager -->

    <script type="text/javascript">
        var _iub = _iub || [];
        _iub.csConfiguration = {
            lang: 'en',
            siteId: 896537, //use your siteId
            cookiePolicyId: 8207462, //use your cookiePolicyId

            enableCcpa: true,
            ccpaApplies: true,

            enableGdpr: true,
            gdprAppliesGlobally: false,
            gdprApplies: true,
            perPurposeConsent: true,

            timeoutLoadConfiguration: 30000,
            consentOnScroll: false, //avoid consent to be given when the user scrolls the page

            banner: {
                position: 'float-top-center',
                acceptButtonDisplay: true,
                customizeButtonDisplay: true,
                rejectButtonDisplay: true,
            callback: {
                onPreferenceExpressedOrNotNeeded: function(preference) {
                        iubenda_ccpa_opted_out: _iub.cs.api.isCcpaOptedOut()
                    if (!preference) {
                            event: "iubenda_preference_not_needed"
                    } else {
                        if (preference.consent === true) {
                                event: "iubenda_consent_given"
                        } else if (preference.consent === false) {
                                event: "iubenda_consent_rejected"
                        } else if (preference.purposes) {
                            for (var purposeId in preference.purposes) {
                                if (preference.purposes[purposeId]) {
                                        event: "iubenda_consent_given_purpose_" + purposeId
    <script async src="//"></script>

        <div class="wrapper">
            <h1>iubenda Cookie Solution</h1>
            <p>Google Tag Manager integration for CCPA, GDPR and per-category consent</p>

    <section class="wrapper">

        <p>💡 Click on "Accept", "Reject", "Learn more and customize" and "Do Not Sell My Personal Information" to customize your consent preferences for cookies.</p>
        <div class="scripts">
          <div class="script" id="no-purpose"> No Purpose</div>
          <div class="script" id="no-purpose-sells"> No Purpose - Sale (to be blocked when CCPA opted out)</div>
          <div class="script" id="purpose-1"> Strictly Necessary (no consent required)</div>
          <div class="script" id="purpose-2"> Basic Interactions & Functionalities</div>
          <div class="script" id="purpose-3"> Experience Enhancement</div>
          <div class="script" id="purpose-4"> Analytics</div>
          <div class="script" id="purpose-4-sells"> Analytics - Sale (to be blocked when CCPA opted out)</div>
          <div class="script" id="purpose-5"> Targeting & Advertising</div>

        <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>). Just refresh the page to make the cookie banner reappear.</li>

        <h3>Learn more</h3>
        <div class="tip">
          <p>Read the guide <a href="" target="_blank">How to Use Google Tag Manager to Simplify the Blocking of Cookies</a> for more information about additional settings.</p>

        <p>Other helpful resources:</p>
        <ul class="guides">
            <li><a href="" target="_blank">Cookie Solution - Getting Started</a></li>
            <li><a href="" target="_blank">How to Customize the Look and Behavior of the Cookie Banner (Beginner's Guide)</a></li>
            <li><a href="" target="_blank">How to Configure Your Cookie Solution (Advanced Guide)</a></li>
            <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 CSS (just for demo purposes) */

div.scripts .script {
  border-bottom: 1px solid #D5D5D5;
  margin-bottom: -1px;
  padding: 14px 6px;

div.scripts .script:last-of-type {
  border-bottom: none;

div.scripts .script:before {
  content: '🚫';

div.scripts .script.activated:before, 
div#purpose-1:before {
  content: '✅';


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

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

// for testing purposes only to avoid setting the CCPA cookie
_iub.csConfiguration.callback.onCcpaOptOut = _iub.csConfiguration.callback.onCcpaAcknowledged = function() {
    setTimeout(function() {