• Resolved José

    (@zeh32)


    Hello,

    I need to exclude a JS snippet that is “injected” on every page of my website by a plugin. This piece of code is responsible to assign Facebook Pixel events.

    I have a lot of products on my website and each product generates its own JS file on wp-content/litespeed/js only because of that piece of code.

    So I think that if there is a way to not combine this Facebook Pixel code, I could have only one JS optimization file for all of my products. Is that right?

    Regards,

    José

    • This topic was modified 3 years, 3 months ago by José.
Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi,

    If you don’t want that JS to be included in the JS Combined file, then enter that JS in the JS Excludes box under the [7] Tuning tab of the LiteSpeed Cache Page Optimization.

    Regards.

    Thread Starter José

    (@zeh32)

    Hello,

    The problem is that I don’t know how to exclude that.

    If it was a separate file, I could just add its URL, but it is not.

    The JS snippet is directly placed in the HTML by the plugin.

    It is something like:

    <script type="text/javascript" id="pys-js-extra"> ... </script>

    Regards

    Plugin Support qtwrk

    (@qtwrk)

    could you please share a full code that added by other plugin ?

    Thread Starter José

    (@zeh32)

    Hello,

    Of course! When I compare two generated JS files with almost the same size, the piece of code below differs.

    ;var pysOptions={"staticEvents":{"facebook":{"PageView":[{"delay":0,"type":"static","name":"PageView","pixelIds":["*"],"params":{"page_title":"Bala Frutibelo Framboesa Peccin 600g","post_type":"product","post_id":1615,"plugin":"PixelYourSite","user_role":"guest","event_url":"jadoces.com.br\/p\/bala-frutibelo-framboesa-peccin-600g\/"},"ids":[],"hasTimeWindow":!1,"timeWindow":0,"eventID":"","woo_order":"","edd_order":""}],"ViewContent":[{"delay":0,"type":"static","name":"ViewContent","pixelIds":["*"],"params":{"content_ids":["1615"],"content_type":"product","content_name":"Bala Frutibelo Framboesa Peccin 600g","category_name":"Balas, Balas mastig\u00e1veis","value":6.8,"currency":"BRL","contents":[{"id":"1615","quantity":1}],"product_price":6.8,"page_title":"Bala Frutibelo Framboesa Peccin 600g","post_type":"product","post_id":1615,"plugin":"PixelYourSite","user_role":"guest","event_url":"jadoces.com.br\/p\/bala-frutibelo-framboesa-peccin-600g\/"},"ids":[],"hasTimeWindow":!1,"timeWindow":0,"eventID":"","woo_order":"","edd_order":""}]}},"dynamicEvents":{"signal_form":{"facebook":{"delay":0,"type":"dyn","name":"Signal","pixelIds":["*"],"params":{"event_action":"Form","page_title":"Bala Frutibelo Framboesa Peccin 600g","post_type":"product","post_id":1615,"plugin":"PixelYourSite","user_role":"guest","event_url":"jadoces.com.br\/p\/bala-frutibelo-framboesa-peccin-600g\/"},"ids":[],"hasTimeWindow":!1,"timeWindow":0,"eventID":"","woo_order":"","edd_order":""}},"signal_download":{"facebook":{"delay":0,"type":"dyn","name":"Signal","extensions":["","doc","exe","js","pdf","ppt","tgz","zip","xls"],"pixelIds":["*"],"params":{"event_action":"Download","page_title":"Bala Frutibelo Framboesa Peccin 600g","post_type":"product","post_id":1615,"plugin":"PixelYourSite","user_role":"guest","event_url":"jadoces.com.br\/p\/bala-frutibelo-framboesa-peccin-600g\/"},"ids":[],"hasTimeWindow":!1,"timeWindow":0,"eventID":"","woo_order":"","edd_order":""}},"signal_comment":{"facebook":{"delay":0,"type":"dyn","name":"Signal","pixelIds":["*"],"params":{"event_action":"Comment","page_title":"Bala Frutibelo Framboesa Peccin 600g","post_type":"product","post_id":1615,"plugin":"PixelYourSite","user_role":"guest","event_url":"jadoces.com.br\/p\/bala-frutibelo-framboesa-peccin-600g\/"},"ids":[],"hasTimeWindow":!1,"timeWindow":0,"eventID":"","woo_order":"","edd_order":""}}},"triggerEvents":[],"triggerEventTypes":[],"facebook":{"pixelIds":["*"],"advancedMatching":[],"removeMetadata":!1,"contentParams":{"post_type":"product","post_id":1615,"content_name":"Bala Frutibelo Framboesa Peccin 600g","categories":"Balas, Balas mastig\u00e1veis","tags":""},"commentEventEnabled":!0,"wooVariableAsSimple":!1,"downloadEnabled":!0,"formEventEnabled":!0,"ajaxForServerEvent":!0,"serverApiEnabled":!1,"wooCRSendFromServer":!1},"debug":"","siteUrl":"https:\/\/jadoces.com.br","ajaxUrl":"https:\/\/jadoces.com.br\/wp-admin\/admin-ajax.php","enable_remove_download_url_param":"1","gdpr":{"ajax_enabled":!1,"all_disabled_by_api":!1,"facebook_disabled_by_api":!1,"analytics_disabled_by_api":!1,"google_ads_disabled_by_api":!1,"pinterest_disabled_by_api":!1,"bing_disabled_by_api":!1,"facebook_prior_consent_enabled":!0,"analytics_prior_consent_enabled":!0,"google_ads_prior_consent_enabled":null,"pinterest_prior_consent_enabled":!0,"bing_prior_consent_enabled":!0,"cookiebot_integration_enabled":!1,"cookiebot_facebook_consent_category":"marketing","cookiebot_analytics_consent_category":"statistics","cookiebot_google_ads_consent_category":null,"cookiebot_pinterest_consent_category":"marketing","cookiebot_bing_consent_category":"marketing","consent_magic_integration_enabled":!1,"real_cookie_banner_integration_enabled":!1,"cookie_notice_integration_enabled":!1,"cookie_law_info_integration_enabled":!1},"edd":{"enabled":!1},"woo":{"enabled":!0,"addToCartOnButtonEnabled":!1,"addToCartOnButtonValueEnabled":!0,"addToCartOnButtonValueOption":"price","singleProductId":1615,"removeFromCartSelector":"form.woocommerce-cart-form .remove"}}

    There are some unique elements on this snippet, just like “page_title” and “post_id” attributes, for example.

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    in your above example , you can use keyword like facebook , see if it helps , and please do remember to purge all after you made change.

    Best regards,

    Thread Starter José

    (@zeh32)

    Hello,

    So, where should I use this keyword?

    Can’t I use a more specific word, like “pysOptions” to avoid another errors?

    Regards,

    José

    Plugin Support qtwrk

    (@qtwrk)

    pysOptions is also usable , any string you extract from that inline code is okay , but try to narrow it down itself , as no other inline code will have same string

    Thread Starter José

    (@zeh32)

    Ok, and where should I use this keyword?

    Plugin Support qtwrk

    (@qtwrk)

    page optimization -> tune setting -> JS exclude

    Thread Starter José

    (@zeh32)

    Did it and worked great! Thank you!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Exclude JS to be combined’ is closed to new replies.