Second Street Dev Kit (SDK)
  1. Second Street Help Center
  2. Second Street Dev Kit (SDK)

Kiosk Mode

Overview

Consider enabling Kiosk Mode at conferences or other events where multiple people are encouraged to fill out either a Sweepstakes or Survey form one after another.

Kiosk Mode can be enabled by inputting a snippet of code immediately before our embed code on an embedded page, or before the SS-APP token in your scrape page or custom html.

The snippet of code sets an amount of time (in milliseconds) for the Thank You Page to display, before resetting the form for the next user or entrant.

The Snippet

<script>

  window.SecondStreetSDK = {

    version: '1.0.0',

    ready: function ready(secondstreet) {

      var TIME_TO_SHOW_THANKS_PAGE_IN_MILLISECONDS = 3000; // ms



      secondstreet.addEventListener('secondstreet:form:submitted', function() {

        secondstreet.timer(TIME_TO_SHOW_THANKS_PAGE_IN_MILLISECONDS).then(function() {

          secondstreet.logout();

          secondstreet.visit('/');

        });

      });

    }

  };

</script>

The number in bold (above) is what determines how long the Thank You Page is presented - in milliseconds - in the browser.

Example: If you'd like the form to reset after 5 seconds, update the fifth line of code to be

var TIME_TO_SHOW_THANKS_PAGE_IN_MILLISECONDS = 5000; // ms

Heads up! If any code is changed, other than the amount of time, the script will break and Kiosk Mode may not function properly. This may also impact other functionality related to form page submissions.

On an Embedded Page

  • Copy the snippet from above
  • Paste the snippet, along with the embed code from the Publish step of a promotion's setup, into your content management system.
  • The full code will look similar to the example below. 

Example

<script>

  window.SecondStreetSDK = {

    version: '1.0.0',

    ready: function ready(secondstreet) {

      var TIME_TO_SHOW_THANKS_PAGE_IN_MILLISECONDS = 3000; // ms




      secondstreet.addEventListener('secondstreet:form:submitted', function() {

        secondstreet.timer(TIME_TO_SHOW_THANKS_PAGE_IN_MILLISECONDS).then(function() {

          secondstreet.logout();

          secondstreet.visit('/');

        });

      });

    }

  };

</script>

<!--[if lte IE 11]> <div style="width: 100%; background: red; border: 1px black; padding-top: 10px; padding-bottom: 10px; color: #fff; text-align: center; font-weight: bold; font-size: 18px"> Sorry, you are using an unsupported browser. This page will not display correctly. <br /> <a href="https://www.unsupportedbrowser.site/" style="color: #fff;" target="_blank"> Please click here to upgrade to a newer browser. </a> </div> <![endif]--> <script src="https://embed-642618.secondstreetapp.com/Scripts/dist/embed.js" data-ss-embed="promotion" data-opguid="abc-123-def-456-ghi-789-jkl" data-routing="hash">/**/</script>

With a Scrape Page or with Custom HTML

Scrape Page

  • Copy the snippet from above.
  • Paste the snippet into the Scrape Page generated from your content management system (CMS), above the SS-APP token.
  • In the Publish step of your promotion, click to Edit a One-Time Wrapper or Override your Default Wrapper.
  • Select the Scrape Page option.
  • Paste the Scrape Page URL on the line provided.

Custom HTML

  • Copy the snippet from above.

  • In the Publish step of your promotion, click to Edit a One-Time Wrapper or Override your Default Wrapper.
  • Select the Custom HTML option.
  • Paste the snippet above the SS-APP token in the Custom HTML editor.

    Example Walkthrough - Custom HTML Option:

    kiosk

        Example Code:

        <!DOCTYPE html>
        <html lang="en">
        <head>
        <title></title>
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
        <link rel="stylesheet" type="text/css" href="/StaticContent/CSS/default_wrapper-9e84f29b9c200ed7280e8139f94b3caf.css" />
        </head>
        <body class="ssDefaultWrapper">
        <script>

        window.SecondStreetSDK = {

        version: '1.0.0',

        ready: function ready(secondstreet) {

        var TIME_TO_SHOW_THANKS_PAGE_IN_MILLISECONDS = 3000; // ms

        secondstreet.addEventListener('secondstreet:form:submitted', function() {


        secondstreet.timer(TIME_TO_SHOW_THANKS_PAGE_IN_MILLISECONDS).then(function() {

        secondstreet.logout();

        secondstreet.visit('/');

        });

        });

        }

        };

        </script>
        {SS-APP}
        </body>
        </html>