• Resolved wpdev8195

    (@wpdev8195)


    Just for other people’s reference, since I could not find any documentation on this and spent hours of head-banging figuring it out.

    Install this script as an HTML block on the Thank-You page of your Store Checkout funnel to get the Google Merchant Center “Customer Reviews” functionality enabled without a plugin, for free.

    <script src=”https://apis.google.com/js/platform.js?onload=renderOptIn&#8221; async defer></script>

    <script>

      let delivery_date = new Date(new Date().setDate(new Date().getDate() + 14)).toISOString().split(‘T’)[0];

      window.renderOptIn = function() {

        window.gapi.load(‘surveyoptin’, function() {

          window.gapi.surveyoptin.render(

             {

    ??????????“merchant_id”: “123456789”,

              “order_id”: “[wfty_order_number]”,

              “email”: “[wfty_customer_email]”,

              “delivery_country”: “US”,

              “estimated_delivery_date”: delivery_date,

            }

          );

        });

      }

    </script>

    Notes

    • The merchant ID is hardcoded and matches the merchant ID from Google Merchant Center. REPLACE THIS WITH YOUR MERCHANT ID.
    • The delivery country is hard coded to US in this example. If you are shipping to multiple countries, you will need to find a dynamic solution to this. Sorry, I don’t know how to do that.
    • The variable delivery_date, which is used to generate an estimated delivery date for Google, is not wrapped in quotes.?
    • Hardcoded values and values that are using the Funnelkit short codes are included in double quotes.
    • If you are copying this code fromand pasting it, make sure that none of the quotation marks get changed to a different style. They need to be the straight, plain style of quotation marks, otherwise the code will break.

    Changing the estimated delivery date

    On this line

     let delivery_date = new Date(new Date().setDate(new Date().getDate() + 14)).toISOString().split(‘T’)[0];

    change the number 14 to the estimated number of days until the customer will receive their bike. Eg 5, 7, 10, 20, etc. Google uses this date to determine when they will send the email.They want to send the email after the customer has already received the product, so that the customer has an opportunity to accurately evaluate the store.

    Where to install the script

    The script needs to be installed using the visual builder using an html block.

    If it is installed using the funnel kit settings using the “External Script” box, it will not work properly because it will not load the data from the shortcodes.

    “Steps” -> Thank You -> Settings -> External Script – DO NOT USE

    DO go to Design -> Edit Block Editor Template. This will open the Gutenberg visual builder. Then add a custom html block at the bottom of the page below all the other blocks, and copy and paste the script into it.

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.