Limiting registrations for your event

This article will cover the steps needed to set up your event to limit the number of registrations.

 

Pro Feature: This feature requires a Pro or higher account. Upgrade today.

Create your event in SimpleEvents

  1. Open up SimpleEvents.io and create your new event.
  2. Check the box to limit registration.
  3. Change your max registration message as needed.
  4. Then, create your event.

simpleevents-limiting-registration-setup

Recommendation: Use the HubSpot Landing Page for your event!

Add the Custom script

You need to install this script once when you use the HubSpot forms.

  • If you use HubSpot landing pages (or website), follow the steps within Option 1.
  • If you use another platform (like WordPress) and use Google Tag Manager (GTM) follow Option 2.
<script>
//SimpleEvents Max Registration Helper
  window.addEventListener('message', function (event) {
    if (event.data.type === 'hsFormCallback' && event.data.eventName === 'onFormReady') {
      // Select all forms on the page
      const forms = document.querySelectorAll('form');

      // Iterate over each form
      forms.forEach(form => {
        // Check if the form contains an element with the .maxRegistration class
        if (form.querySelector('.maxRegistration')) {
          // Find the .actions div within this form
          const actionsDiv = form.querySelector('.actions');

          // If the .actions div is found, remove it
          if (actionsDiv) {
            actionsDiv.remove();
          }
        }
      });
    }
  });
</script>

Option 1: Add the Custom code block to your Pages Footer

You only have to do this one time for your entire account. 

  1. Open up your Pages settings.
  2. Insert the following code within your Site footer HTML block.

Example of the script installed in the Site footer HTML section.

simpleevents-site-footer-html-script

This code will remove the submit button when your event reaches maximum registration.

Option 2: Add the Custom code block to Google Tag Manager (GTM) or to your site footer.

  1. Create a new Tag
  2. Tag Configuration: Custom HTML
    1. HTML is the code above.
    2. Triggering: All Pages

Example of GTM setup:

simpleevents-gtm-custom-script-to-all-pages

Launch your event

Your setup is complete! Run your event!