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> 
    <title>Home Questionnaire</title> <span id="selection-marker-1" class="redactor-selection-marker"></span>
<h1>What is your favorite place to travel?</h1> 
<p>I am building a directory of the sweetest travel destinations.</p>  
<form name="travel" onsubmit="identify(event)">
     What is your favorite travel destination?
    <input name="destination" required="" size="81" type="text"/> 
    Any recommendations (cool things to do, places to visit or restaurants to eat)? 
    <textarea cols="81" name="details" required="" rows="10">
    Name: <input name="fullname" required="" size="75" type="text"/> 
    Email: <input name="email" required="" size="75" type="email"/> 
    <input name="submit" type="submit" value="submit"/>
 <!--  Div Below is where consent manager will be injected to  -->
  <div id="target-container"></div>


                 #target-container {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;


//code below loads consentManagerConfig object and specifies content popup contains. Need to update with your own writeKey and what container code should be injected to, I am using empyty div 

//note, may need to view demo in debug mode to save tracking preferences in browser

window.consentManagerConfig = function(exports) {
      return {
       //Need to update with the container where you want Consent Manager to load
        container: '#target-container',
        //Need to update with you 
        writeKey: 'VuOZbPNXuR76IXTQeYaU6twg3qpSNAw9',
          'Consent manager is awesome! We use cookies (and other similar technologies) to collect data to improve your experience on our site. Also, Segment is Awesome',
        bannerSubContent: 'You can change your preferences at any time.',
        preferencesDialogTitle: 'Website Data Collection Preferences',
          'We use data collected by cookies and JavaScript libraries to improve your browsing experience, analyze site traffic, deliver personalized advertisements, and increase the overall performance of our site.',
        cancelDialogTitle: 'Are you sure you want to cancel?',
          'Your preferences have not been saved. By continuing to use our website, you are agreeing to our Website Data Collection Policy',
        closeBehavior: 'accept',

<!--script that loads Prebuilt Consent Manager UI via Preact-->
 <script src=""> </script>

<!--Load Analytics.js-->
        !(function() {
          var analytics = ( = || [])
          if (!analytics.initialize)
            if (analytics.invoked)
              window.console && console.error && console.error('Segment snippet included twice.')
            else {
              analytics.invoked = !0
              analytics.methods = [
                //methods below needed for consent manager version 5.0.0 and greater!!
              analytics.factory = function(t) {
                return function() {
                  var e =
                  return analytics
              for (var t = 0; t < analytics.methods.length; t++) {
                var e = analytics.methods[t]
                analytics[e] = analytics.factory(e)
              analytics.load = function(t, e) {
                var n = document.createElement('script')
                n.type = 'text/javascript'
                n.async = !0
                n.src =
                  ('https:' === document.location.protocol ? 'https://' : 'http://') +
                  '' +
                  t +
                var o = document.getElementsByTagName('script')[0]
                o.parentNode.insertBefore(n, o)
                analytics._loadOptions = e
              analytics.SNIPPET_VERSION = '4.1.0'

<!--Javascript that controls form submits and mapping user input data to Segment Analytics.js methods-->
<script type="text/javascript">
    function identify(e){
      var form =;
      var email = form["email"].value;
      var fullname = form["fullname"].value;
      var destination = form["destination"].value;
      var details = form["details"].value;
      var user = {
          email: email, 
          name: fullname, 
          destination: destination, 
          details: details
      analytics.identify('1234', {
          email: email, 
          name: fullname
      analytics.track('destination submitted', user, , function() {
          window.location.href = "";
      });'Home', user, {
        url: "/" 
      analytics.alias('507f191e81');"0e8c78ea9d97a7b8185e8632", {
            name: "Initech", 
            industry: "Technology",
            employees: 329, 
            plan: "enterprise", 
            "total billed": 830