Running Yotpo with Rocket Loader (Legacy)

      Running Yotpo with Rocket Loader (Legacy)


        Article Summary

        Products


        Reviews
        Supported plans

        N/A

        eCommerce Platform

        Shopify, Shopify Plus, Adobe Commerce (Magento), BigCommerce, WooCommerce, Volusion, Salesforce Commerce Cloud, Custom

        Rocket Loader is a general-purpose asynchronous JavaScript loader coupled with a lightweight virtual browser which can safely run any JavaScript code after window.onload.

        Rocket Loader overwrites the original scripts with its own scripts, so instead of seeing the 'text/javascript' script as in this sample WooCommerce page:

        <script type='text/javascript'>
        /* <![CDATA[ */
        var yotpo_settings = {"app_key":"XXX_YOUR_APPKEY_XXX"};
        /* ]]> */
        </script>
        <script type='text/javascript' src='http://127.0.0.1/wordpress/wp-content/plugins/yotpo-social-reviews-for-woocommerce/assets/js/headerScript.js'></script>

        You would see a "text/rocketscript" script tag, which looks like this:

        <script type="text/rocketscript">
        /* <![CDATA[ */
        var yotpo_settings = {"app_key":"XXX_YOUR_APPKEY_XXX"};
        /* ]]> */
        </script>
        <script type="text/rocketscript" data-rocketsrc="https://www.pickpals.com.au/wp-content/plugins/yotpo-social-reviews-for-woocommerce/assets/js/headerScript.js"></script>
        Workaround for None-Hosted Platforms
        Ask the client to login to the Cloudflare settings page and uncheck these three options (Minify JS, 

        Rocket Loader may disrupt Yotpo's activity on your site. Please follow the section relevant to the platform you're using in order to allow the two apps to run together:

        Shopify/BigCommerce

        On hosted platforms such as Shopify and BigCommerce, the easiest way to run Yotpo and Rocket Launcher together is by adding the following code to Yotpo's JavaScript:

        window.onload = function() {

        Add the code between the Script Tag <script type="text/javascript"> and  (function e().

        Important:
        Don't forget to close this section with: };

        Finally - Clear the site cache, refresh, and ensure that everything loads smoothly.

        WooCommerce

        1. Log into to your WooCommerce Admin.
        2. Navigate to Settings >  WP Rocket:
        3. Navigate to Static Files:
        4. Add the following text to the Exclude JS section: 

        /wp-content/plugins/yotpo-social-reviews-for-woocommerce/assets/js/headerScript.js 

        Self-hosted platforms

        Log into the Cloudflare settings page and, in the Speed tab, uncheck these three options:

        • JavaScript
        • CSS
        • HTML 

        Please note:
        Cache purging in the Cloudflare app may be needed in order for the changes to be applied.

        Was this article helpful?