How to Install LeadCenter JavaScript on WordPress

This guide explains how to install your LeadCenter JavaScript on a WordPress website. The script powers external form capture, modal pop-up forms, and visitor tracking. It should load on every page where you want LeadCenter to work.


Where to Get Your Script

  1. Go to Website forms integration.
  2. Open the Actions menu in the top right.
  3. Click Javascript code.
  4. Copy the snippet from the dialog.

The snippet is a small <script> block that loads the LeadCenter scripts. It is safe to include site-wide.


Method 1 (Recommended): Install Site-Wide Using a Plugin

This is the safest method because it survives theme switches and theme updates.

  1. Go to WordPress Dashboard → Plugins → Add New.
  2. Search for and install WPCode or Insert Headers and Footers.
  3. Activate the plugin.
  4. Open the plugin's settings.
  5. Paste the LeadCenter snippet into the Footer field. Header placement also works.
  6. Save.

The script now loads on every page on your site.


Method 2: Add to the Theme Footer

Warning: If you change themes, this code is removed. Use Method 1 unless you know you will not change themes.

  1. Go to Appearance → Theme File Editor.
  2. Open footer.php.
  3. Find the closing </body> tag.
  4. Paste the LeadCenter snippet directly above it.
  5. Click Update File.

Method 3: Install on a Single Page Only

  1. Edit the page where you want LeadCenter to be active.
  2. Add a Custom HTML block at the bottom of the page.
  3. Paste the LeadCenter snippet inside the block.
  4. Update the page.

The script will load only on that page.


Verify Installation

  1. Open your website in a browser.
  2. Open Developer Tools → Network and reload the page.
  3. Look for the LeadCenter script being requested.
  4. Open Developer Tools → Console and confirm there are no LeadCenter errors.

Best Practices

  • Use a plugin. Theme switches will not break your tracking.
  • Install in the footer. Footer placement does not slow page rendering.
  • Clear all caches after installing the script, including browser, CDN, hosting cache, and caching plugin.
  • Test in incognito after installing to bypass your normal browser cache.
  • Add your domain in LeadCenter on the Website forms integration page so submissions are accepted.

Troubleshooting

  • Script not loading? Confirm the plugin is active and the snippet is present in the page source. Clear caches.
  • Security plugin blocking? Allowlist node.leadcenter.ai in your security/firewall plugin.
  • Caching plugin keeping the old page? Purge all caches after install.
  • Forms not capturing? See Troubleshooting: Why Isn't My Form Capturing Leads?

FAQs

Do I need to install the script on every page?

For full coverage, including modal pop-ups, external form capture, and visitor tracking, install it site-wide using Method 1.

Will the script slow down my site?

The script is loaded asynchronously and is small. There is no perceptible impact on page rendering.

What if my page builder strips scripts from posts?

Use the plugin method instead of the in-post Custom HTML block.

Can I use a Google Tag Manager container instead?

Yes. Add the snippet as a Custom HTML tag in Google Tag Manager, set it to fire on All Pages, and publish.


Related Articles

Need more help?

If you can't find the answers you're looking for, our support specialists are available to answer your questions and troubleshoot if necessary.

  • Phone Call (888) 291-7116. Our main hours are Monday to Friday 7 am-5 pm Central Time.
  • Support Send your questions and inquiries via email to support@leadcenter.ai. A support ticket will be created and one of our team members will get back to you as quickly as possible.