[Important] New & Improved Method for Adding LeadForms to Your Pages

As of May 4th 2024, there's a new approach to adding your LeadForm with your website and landing pages. If you're currently experiencing issues please make changes based on this documentation.


It's important to note that the old system will continue to work, until its fully depreciated. We plan to keep the old system running for about six months. However, moving to the new approach will ensure that you're using the most optimal setup.


Watch this video to see exactly what to do step by step

What changed:

  • We've optimized and improved the process around how lead forms load on the page. Each form now has it's own unique pixel script that gets added to the page, rather than adding a 'universal pixel script' to all pages.

For example. here's the pixel script for a form now:

You'll see that it's similar to the previous script, except it contains a token that's unique to each form.

  • Prior to this update, the forms used a URL based system. A target URL was required to be set with every form. This created issues if the target URL was inputted incorrectly or in some cases when UTMs were added to the end of the form. We had to get away from that approach for those reasons, so that's why we created this new approach.
  • This new approach uses a token based system, meaning that the Target URL is no longer required. This not only improves the process of adding the form to a page, but it also reduces the possiblity of errors since the Target URL is no longer needed.
  • The raw code feature is no longer needed because we've optimized the system to the point where the forms can load just as fast (or faster) without raw code. At this point, using raw code adds unnecessary complexity. So we'd recommend removing all raw code from your forms once your pages use this new approach.

What this means for you:

  • You no longer need to add your pixel script to the entire header of your site (unless you're adding one form across your site)
  • Each form is now has it's own unique token which you can embed directly into the page
  • Raw code is no longer needed, since the forms load just as fast without it.

How to add a lead form to your site: The new approach:


The steps for adding the lead form to your site following the new approach are similar to the old method. But the main difference is that each form now has its own unique pixel, which can be added to whatever page you're looking to add your lead form to. You'll find that this actually simplifies the process and removes potential issues with target URLs.


To add a lead form to a page (when embedding)


  • Open the lead form and go to Publish


It's important to note that your pixel script is unique to your form. Each lead form has its own unique pixel script, so you'll only want to add this to the pages that you're looking to add your lead form into.

  • Next click copy token
  • Go to your website or landing page and adde the script to whatever pages you'd like it to appear on.
    • Add the script to the header section of your page. If you can't add it to the header then add it to the HTML of script section of the page
    • If you're adding one form across your entire site, then you can add the pixel script to your entire site. However, if you're adding multiple forms across different pages on your website, then it's recommended to do it on a page by page basis.
  • Next if you're embedding you're lead form then add the following embed code to wherever you'd like the form appear on your page.
  <div class="leadforms-embd-form"><!-- First form --></div> 
  • If the form is set to popup then you do not need the embed code above.

That's it! Please ignore the Target Pages section. This will be depreciated and moved shortly. And if using raw code, please remove the raw code completely from the page.


If you run into any issues with this please send an email to support@getleadforms.com

Still need help? Contact Us Contact Us