← Help Center
Developers4 min read

Embed a signup form on your website

Copy the iFrame or Script snippet for a form, paste it into any page, and know what each one tracks.

Use a snippet to collect signups on your own site. The form stays hosted by InfluencersKit and loads in a frame.

Before you start

  • Build the form and set it live. It only accepts submissions while its status is live.
  • Set your handle, because it's part of the embed address.
  • Tell people what they're signing up for. See consent and unsubscribes.

Copy the snippet

  1. 1Go to Landing Pages & Forms and select Forms.
  2. 2Select Embed on the row for your form.
  3. 3Choose iFrame or Script (better tracking).
  4. 4Select Copy Snippet and paste it into the HTML of your page.
  5. 5Submit the form once with your own address.

iFrame snippet

<iframe
  src="https://your-handle.ikpages.com/api/public/forms/your-handle/your-form/embed"
  width="100%"
  height="500"
  frameborder="0"
  style="border:none;"
></iframe>

Script snippet

This builds the same iframe, then answers the form's ik-track-ready message with the host page's URL and referrer. Copy your own from the dashboard, since it holds your form's slug and title.

<!-- InfluencersKit Form: Your form -->
<div id="ik-form-your-form"></div>
<script>
(function() {
  var containerId = 'ik-form-your-form';
  var embedUrl = 'https://your-handle.ikpages.com/api/public/forms/your-handle/your-form/embed';
  var container = document.getElementById(containerId);
  if (!container) return;
  var iframe = document.createElement('iframe');
  iframe.src = embedUrl;
  iframe.style.cssText = 'width:100%;height:500px;border:none;display:block;';
  iframe.setAttribute('frameborder', '0');
  container.appendChild(iframe);
  // postMessage bridge: send host page referrer and URL to the form
  window.addEventListener('message', function(e) {
    if (e.data && e.data.type === 'ik-track-ready' && iframe.contentWindow) {
      iframe.contentWindow.postMessage({
        type: 'ik-host-context',
        referrer: document.referrer,
        url: window.location.href
      }, '*');
    }
  });
})();
</script>

What happens next

  • A submission adds the person as an active subscriber and starts your active welcome sequences.
  • The visitor sees your thank-you screen or success message.
  • The source on their record is form:your-handle/your-form.
  • Views appear under form analytics.
  • ?ref= and ?rid= referral parameters on the form's address are passed to your referral program.

What can go wrong

What you seeWhy
Form not found in the frameThe form is a draft, or the handle or slug is wrong.
A paused message in the frameThe form is paused. Set it live.
Submit does nothingThe form shows no error when a submission is refused. Check that it's live and that your list isn't at its plan limit.
Referrers show your ikpages addressYou used the iFrame snippet. Use Script.
The snippet shows your-handleYour account has no handle yet. Set one and copy the snippet again.

Frequently asked questions

Which snippet should I use?

Script (better tracking), if your site allows script tags. It's the same form, but it passes the host page's URL and referrer to your analytics. Use iFrame where scripts aren't allowed.

The form looks cut off. How do I fix it?

Both snippets set a height of 500 pixels. Raise height in the iFrame snippet, or height:500px in the Script snippet.

Ready to try it?

Open your dashboard and follow along — or create a free account.