Support » Plugin: Facebook for WooCommerce » Speeding up the plugin

  • Resolved kinduweb

    (@kinduweb)


    Hi, I like your plugin and gave 5* rating. It’s working perfectly. However It decrease site load a lot by external JS and mysql queries. I’m trying to delay load the JS so the FCP increases. I only load them at user interaction. All the scripts working well but delay loading fbevents.js breaking the product page. Could you please help me with that? I can’t find the dependency with fbevents.js at product page JS.

    Regards,

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Support Julie Martin

    (@julieskyverge)

    Hi @kinduweb!

    So pleased that you’re enjoying the plugin, thanks for the kind words!

    In terms of delaying the loading of various scripts and such, we should have a 2.0.0 version out soon. I’d ask that you take a look at that version and then if you still feel the need to delay loading some scripts, would you please open a support thread in the forum?

    Thanks so much!

    Julie 🙂
    SkyVerge

    Thread Starter kinduweb

    (@kinduweb)

    Good to hear that you’re launching new version with expected optimization. Eager to check it. Could you please provide me a link to the support forum?

    I always delay external scripts and load them on user interaction. I believe it is good for user experience and have no harm.

    Cheers,

    Plugin Support Julie Martin

    (@julieskyverge)

    Hey @kinduweb,

    This is the forum right here, you can open up a new thread if there’s any new issue:

    https://wordpress.org/support/plugin/facebook-for-woocommerce/

    Having said that, we released version 2.0.0 today, so I’d recommend you check it out.

    Would you please let me know how that works out for you?

    Thanks so much,

    Julie 🙂
    SkyVerge

    Thread Starter kinduweb

    (@kinduweb)

    Oops, something went wrong.
    This may be because of a technical error that we’re working to fix. Please try reloading this page.

    Thread Starter kinduweb

    (@kinduweb)

    Getting this message after ttrying to re add. I think profiles with multiple business admin access are having this issue. Also new version doesn’t create new catalogue. So if you install it to a new site there is a problem with catelogue.

    Thread Starter kinduweb

    (@kinduweb)

    The issue has been fixed reinstalling the plugin after I remove woocommerce v2 from facebook profile business app and cleaned database of wc_facebook.

    But the actual problem with fbevents.js dependency on product page remains. Is it not possible to delay fbevents.js at all?

    Plugin Support Julie Martin

    (@julieskyverge)

    Hi @kinduweb,

    Thanks for confirming the fbevents.js issue remains for you. I’m going to confer with a colleague on this and will come back to you once I have some information here.

    I should note that this would be technically a customization, so while we’ll try to point you in the right direction, I’m not certain we’ll be able to solve the issue. Still, we’ll give it a try.

    Thanks so much,

    Julie 🙂
    SkyVerge

    Plugin Support Julie Martin

    (@julieskyverge)

    Hi @kinduweb,

    Thanks for your patience here while I spoke with a colleague about this.

    My colleague confirms that the fbevents.js is setup as part of the pixel initialization code. As such, delaying this will likely delay the creation of the fbq() function, which is used to track events throughout the site.

    It’s quite likely that this means that when the customer visits the product page, the product page view event is being triggered:

    // ViewContent for individual products
    add_action( ‘woocommerce_after_single_product’, [ $this, ‘inject_view_content_event’ ] );

    If it tries to call fbq() at that point and it’s not loaded, it’ll probably mean you’ll see an undefined function error in the browser console.

    Would you please confirm that for me?

    Thanks so much,

    Julie 🙂
    SkyVerge

    Thread Starter kinduweb

    (@kinduweb)

    Yes, I have tested that with different themes and saw delaying this causing layout shift on product page. And it seems this is unavoidable as you said it will likely delay the creation of the fbq(). My sole concern is to sped up the plugin. And currently the fbevents.js taking much time to load.

    Regards,

    Plugin Support Julie Martin

    (@julieskyverge)

    Hi @kinduweb!

    Thanks so much for confirming that. I’m going to let my product team know that you’re interested in speeding up the page load when the plugin is active, so they’re aware that this is a concern for you.

    In the meantime, I have another suggestion.

    You could technically disable our pixel tracking in the plugin and use a third-party option that wouldn’t require immediate page load to track things, or you could build a custom tracker instead. While this wouldn’t fall under the SkyVerge support policy, you can disable our built-in pixel tracking with two snippets for the moment.

    Here’s the main one:

    add_filter( 'facebook_for_woocommerce_integration_pixel_enabled', 'check_cn_has_been_accepted', 10, 1 );

    And we presently have something we need to iron out due to how the initialization code is loaded, so for the time being, you’d need this one too:

    https://gist.github.com/4a932bcf481420ad20d563fe7462c752#file-sv_fb_for_woocommerce_adjust_apply_filters_hook-php

    I hope that’s helpful! In the meantime, I’ve made a note for my product team about page load concerns and I’m hopeful we’ll be able to tackle that in a future release.

    Thanks so much for your feedback here. Is there anything else I can help out with? Please don’t hesitate to let me know.

    Julie 🙂
    SkyVerge

    Thread Starter kinduweb

    (@kinduweb)

    Thanks for support. 🙂

    Plugin Support Julie Martin

    (@julieskyverge)

    Hey @kinduweb!

    Of course, happy to help.

    If there’s anything else I can do for you, please don’t hesitate to open up a new support thread!

    Thanks so much,

    Julie 🙂
    SkyVerge

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Speeding up the plugin’ is closed to new replies.