JS for leadpages popup stopped working

Going crazy over here.

Button leads to a leadpages leadbox pop up. Plugged the java into my child theme’s functions.php (see below) but upon changing the url of the leadbox, it no longer works. It’s simply loading the leadbox not as a popup (java’s not working) but as it’s own page.

Site: www.fitteacheracademy.com

Code from child theme functions.php:

    function third_party_code() { ?>
    	<script src="//static.leadpages.net/leadboxes/current/embed.js" async defer></script>
    	<script src="//code.tidio.co/88133yc230x6kvgvdwbs2nns296htppx.js"></script>
    <?php
    }
    add_action( 'wp_head', 'third_party_code' );

Any ideas where I’m going wrong all of a sudden? Thanks!

Hi there,

The code you added to the functions.php is correct regarding the rules of adding stuff to the header of the website. And I checked the front end code and those 2 links you added are indeed loaded:

I am not sure what they supposed to do and why they do not. That is something which you need to check with the developers of that feature.

The only thing that comes to my mind is to test the cases below:

  1. Clear all caches including browser cache then deactivate your caching plugins and other optimization plugins.
  2. If you’re using a CDN, please clear the CDN’s cache and disable optimization services.
  3. Test for a plugin conflict. You can do this by deactivating all third-party plugins, and see if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.
  4. Remove custom CSS and Javascript from the options or Child Theme and test the case.
  5. Change the theme from X to default WordPress theme and try to add the scripts there and see the result so you can find if this is related to the script itself or it is some kind of a conflict.

Thank you.

Thanks for your response.

Upon further review, this appears to be a leadpages issue with the URL being generated. Have opened a support ticket with them.

Thanks again.

-Steve

You are most welcome!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.