Title: Plugin automatically includes JS popup scripts
Last modified: May 24, 2021

---

# Plugin automatically includes JS popup scripts

 *  Resolved [RLDD](https://wordpress.org/support/users/rermis/)
 * (@rermis)
 * [5 years ago](https://wordpress.org/support/topic/plugin-automatically-includes-js-popup-scripts/)
 * Is it possible to add a checkbox to settings so that popup form scripts can be
   turned off? There is a checkbox for “Enable Klaviyo signup forms”, but unchecking
   it still causes popup scripts to be included. We need to add additional conditional
   logic (like user role) before some popups scripts, but the plugin is including
   the script on all pages. There’s no way for us to suppress the popup scripts 
   without deactivating the plugin entirely.

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Plugin Author [klaviyo](https://wordpress.org/support/users/klaviyo/)
 * (@klaviyo)
 * [5 years ago](https://wordpress.org/support/topic/plugin-automatically-includes-js-popup-scripts/#post-14477440)
 * Hi [@rermis](https://wordpress.org/support/users/rermis/)
 * The “Enable Klaviyo Signup Forms” checkbox enables the widget to add a Klaviyo
   embedded form. It will not preclude injecting the klaviyo.js snippet which handles
   signup forms and onsite tracking (Active on Site, etc.).
 * With regard to this request, “We need to add additional conditional logic (like
   user role) before some popups scripts” would either the ability to apply a filter
   before conditionally injecting Klaviyo’s javascript or an option in the settings
   form to exclude Klaviyo’s javascript on certain post types suit your needs?
 * Best,
    Klaviyo
 *  Thread Starter [RLDD](https://wordpress.org/support/users/rermis/)
 * (@rermis)
 * [5 years ago](https://wordpress.org/support/topic/plugin-automatically-includes-js-popup-scripts/#post-14477551)
 * Hi, thanks for your response. I think a filter might work, especially if we could
   pass an array of form IDs to be (or not be) displayed.
 * Alternately, an additional checkbox relating specifically to Popup forms could
   be added to settings to prevent automatic inclusion of js popup snippets. Then
   we could add the snippet manually on our own.
 * To be clear, the current issue is that it is not known that the Klaviyo plugin
   automatically includes the js popup snippet on all pages, and this feature currently
   cannot be disabled without deactivating the plugin.
 *  Plugin Author [klaviyo](https://wordpress.org/support/users/klaviyo/)
 * (@klaviyo)
 * [5 years ago](https://wordpress.org/support/topic/plugin-automatically-includes-js-popup-scripts/#post-14481056)
 * Hi [@rermis](https://wordpress.org/support/users/rermis/)
 * Thanks for the additional information.
 * Klaviyo’s popup signup forms can be adjusted to only load on specific pages, 
   [this is handled in the Signup Form Builder within Klaviyo](https://help.klaviyo.com/hc/en-us/articles/360002050572-Overview-of-the-Signup-Form-Builder#form-behavior5)(
   see targeting under Form Behavior). Each popup and slide-out form can be adjusted
   individually. Let me know if there’s additional functionality that you cannot
   achieve by adjusting the form behavior within Klaviyo.
 * Klaviyo’s onsite tracking and signup form code is served in the same javascript
   package. We’ve heard feedback that it would be useful to provide the ability 
   to exclude Klaviyo’s javascript package on certain post types. This would, of
   course, disable onsite tracking in addition to signup form on pages where it 
   was excluded. Would this suit your needs?
 * Best,
    Klaviyo
 *  Thread Starter [RLDD](https://wordpress.org/support/users/rermis/)
 * (@rermis)
 * [5 years ago](https://wordpress.org/support/topic/plugin-automatically-includes-js-popup-scripts/#post-14481103)
 * Hi, thank you for the details.
 * The behavior functionality not available to us for popups includes geo-location
   by state, and user role in WordPress. We hope to wrap the JS in our own conditionals,
   however we are unable to achieve this with the plugin active, since it includes
   the js package on every page.
 * Is there any way to split out the popup js from the js package so we can further
   control when the popups are triggered?
 *  Plugin Author [klaviyo](https://wordpress.org/support/users/klaviyo/)
 * (@klaviyo)
 * [5 years ago](https://wordpress.org/support/topic/plugin-automatically-includes-js-popup-scripts/#post-14481598)
 * Hi [@rermis](https://wordpress.org/support/users/rermis/)
 * Thanks again for this information. Unfortunately, there is not a way to split
   out the signup form and onsite tracking code.
 * In order to further refine to whom a popup form displays the entire Klaviyo javascript
   package would need to be removed. As such, I have created a feature request to
   investigate introducing a filter which could allow some additional conditions
   for enqueuing Klaviyo’s javascript package.
 * Best,
    Klaviyo
 *  [kiscsiszu](https://wordpress.org/support/users/kiscsiszu/)
 * (@kiscsiszu)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/plugin-automatically-includes-js-popup-scripts/#post-14669827)
 * I would also love if the javascript handling of the plugin is optimized. Currently
   my biggest problem in pagespeed insights is klaviyo plugin, eating valuable runtime.
   If this can be more event driven and not automatic, I would be happy.
    Please
   let me know if I can optimize anything on it.
 *  Plugin Author [klaviyo](https://wordpress.org/support/users/klaviyo/)
 * (@klaviyo)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/plugin-automatically-includes-js-popup-scripts/#post-14701663)
 * Hi [@kiscsiszu](https://wordpress.org/support/users/kiscsiszu/)
 * Thanks for the feedback. Can you please elaborate on your desire for Klaviyo’s
   onsite javascript to “be more event driven”? This javascript handles onsite tracking
   and signup forms and therefore needs to be present at page load for much of the
   functionality to work as intended. However, with a better understanding of what
   you are trying to achieve we may be able to improve how this code is added in
   the plugin.
 * Best,
    Klaviyo
 *  Thread Starter [RLDD](https://wordpress.org/support/users/rermis/)
 * (@rermis)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/plugin-automatically-includes-js-popup-scripts/#post-14701744)
 * Hi,
    Thanks for considering! I would like to be able to trigger JS popups manually.
   Currently, if the plugin is installed, popups occur with no ability to suppress.
   Therefore if we have a specific user group that should not receive the popup 
   we are unable to suppress.
 * The behavior functionality not available to us for popups includes geo-location
   by state, and user role in WordPress. We hope to wrap the JS in our own conditionals.
   We are unable to do this now since the popups are triggered on their own.
 *  [kiscsiszu](https://wordpress.org/support/users/kiscsiszu/)
 * (@kiscsiszu)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/plugin-automatically-includes-js-popup-scripts/#post-14709461)
 * Hi [@rermis](https://wordpress.org/support/users/rermis/) ,
 * I don’t know if it helps for you or not (I assume not) nevertheless we managed
   to load JS from klaviyo a bit more dynamic with the plugin “Asset CleanUp: Page
   Speed Booster”
    With this we are loading it only on pages where there is a signup
   form or something interesting to track. For us the top issue considering the 
   page speed is klaviyo’s JS execution.
 *  Thread Starter [RLDD](https://wordpress.org/support/users/rermis/)
 * (@rermis)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/plugin-automatically-includes-js-popup-scripts/#post-14710310)
 * Thanks kiscsiszu,
    That is almost helpful, but we have page rules covered in 
   the klaviyo settings. What we’re hoping to achieve with dynamic loading is control
   over geo-location by state, and user role in WordPress.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Plugin automatically includes JS popup scripts’ is closed to new replies.

 * ![](https://ps.w.org/klaviyo/assets/icon-256x256.png?rev=2877261)
 * [Klaviyo](https://wordpress.org/plugins/klaviyo/)
 * [Support Threads](https://wordpress.org/support/plugin/klaviyo/)
 * [Active Topics](https://wordpress.org/support/plugin/klaviyo/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/klaviyo/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/klaviyo/reviews/)

 * 10 replies
 * 3 participants
 * Last reply from: [RLDD](https://wordpress.org/support/users/rermis/)
 * Last activity: [4 years, 10 months ago](https://wordpress.org/support/topic/plugin-automatically-includes-js-popup-scripts/#post-14710310)
 * Status: resolved