# Time-Delayed Popup

> Discover how to add delayed popup surveys to your website for better user engagement and valuable insights.

Source: https://getmetasurvey.com/help/how-to-implement-a-time-delayed-popup-survey/

Here's a short guide on how to automatically pop up a survey on your website after a specified time:

1. Get Your Popup Embed Code:

Navigate to your survey -> click **Share** menu -> select **Embed on website** -> select **Popup** -> click **Copy code**.

1. Add the JavaScript Snippet:

Once you have the embed code, you can add the following JavaScript snippet to your website. Please add this under your Popup embed code. Make sure to replace `WAIT_SECONDS` with desired time in seconds for the survey to appear.

```
<script>
  const WAIT_SECONDS = 5;

  window.addEventListener('load', () => {
    const msBtn = document.querySelector('[id^="metasurvey-button"]');

    if (msBtn) {
      // msBtn.style.display = "none"; // Hide the button
      setTimeout(() => msBtn.click(), WAIT_SECONDS * 1000);
    }
  });
</script>
```

You can also uncomment `// msBtn.style.display = "none";` by removing the two slashes `//` at the beginning to hide the call-to-action button.

1. Test on Your Website:

Finally, test your website to ensure that the survey popup appears after the specified time.