Google Tag Manager example: Add to waitlist

Here's a Google Tag Manager tag example to add a "Add to waitlist" button link to your website, if a unit type is not available

By default the customer portal unit type list shows "Not available" when a unit type has no more availibilities:

Create a GTM "Custom HTML" tag

  setTimeout(function () {
    var siteMatch = location.pathname.match(/^\/sites\/([\w-]+)$/);
    if (siteMatch) {
      document.querySelectorAll('.sgc-main > div > div:nth-child(2):has(>span)').forEach(function (na) {
        var wl = document.createElement('a');
        wl.className = 'btn btn-gray-light px-2 px-md-4 fw-500';
        wl.href = '' + siteMatch[1];
        wl.textContent = 'Add to waitlist';
        na.replaceWith(wl); // replace all "Non available buttons by a waitlist link
  }, 100);

note: adjust the href URL above to your website

and 2 triggers:

As a result, the unit types list will now show:

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us