Settings

Manage your account and preferences

Account
WordPress Embed Script

Paste this script into a WordPress Custom HTML block on any page or post. It uses Shadow DOM to keep the quiz isolated from your WordPress theme styles — no iframe tag required.

1

In your Quiz List, click the ⋯ menu → Get Embed Script on any published quiz to get a script pre-filled with that quiz's ID.

2

In WordPress, edit a page → Add Block → Custom HTML → paste the script.

3

Publish or update the page. The quiz will load inline with auto-resizing height.

<!-- Quiz Embed -->
<div id="quiz-embed-container" style="width:100%;"></div>
<script>
(function() {
  var QUIZ_ID = 'YOUR_QUIZ_ID'; // Replace with your quiz ID
  var BASE_URL = 'https://golfcreativecosurvey.com';

  var container = document.getElementById('quiz-embed-container');

  var iframe = document.createElement('iframe');
  iframe.src = BASE_URL + '/quiz/' + QUIZ_ID;
  iframe.style.cssText = 'width:100%;border:none;overflow:hidden;display:block;height:500px;';
  iframe.setAttribute('scrolling', 'no');
  iframe.setAttribute('title', 'Quiz');

  // Resize iframe whenever quiz reports its height via postMessage
  window.addEventListener('message', function(e) {
    if (e.data && e.data.type === 'quiz-resize' && e.data.height) {
      iframe.style.height = (e.data.height + 20) + 'px';
    }
  });

  container.appendChild(iframe);
})();
</script>

Replace YOUR_QUIZ_ID with the actual ID found in your quiz URL (e.g. /quiz/abc123), or use the Get Embed Script button on each quiz card to get a pre-filled version.