1. Add the HTML Form
Ensure your HTML form includes thesurface-form-handler class. This class is essential for identifying the form as one that triggers the Surface Form popup. Example:
Add the
surface-form-handler class to any external form that you want to use to trigger the Surface Form popup.2. Modify the Surface Form Embedding Script
Modify the Surface Form Embedding Script to include thedata-question-id attribute.
You must replace the
<question_id> within data-question-id attribute below with the question ID from the Surface Form Builder.
3. Test Your Integration
- Enter a valid email in the input field and press “Submit” or hit “Enter”.
- Verify that the Surface Form popup is displayed as expected.
Optimize Speed
Add the following<link> tags inside the <head> of your site:
Replace
REPLACE ME WITH FORM URL with a Surface Form URL.Explanation
- dns-prefetch → Resolves the domain early to skip DNS lookup delays.
- preconnect → Prepares the TCP + TLS handshake so the browser is ready to request assets immediately.
- prefetch → Fetches the form in advance, so it’s ready when a user opens it.
