Magento 2 : Google Customer ReviewsHow to setup Google Customer Reviews in Magento 2?Magento2: plugin around method not workingI created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error?Cancel the orders which are older than 3 daysWhy is overriding a block function causing template errors?Magento 2 - redirect to final checkout page (checkout success/failed)How to get last ordered product details in Magento 2.2?Magento 2.2.5: Overriding Admin Controller sales/ordermagento 2 place order programmatically from controllerMagento2 checkout/onepage/success redirects to cartMagento 2.3 Can't view module's front end page output?

Why does Deadpool say "You're welcome, Canada," after shooting Ryan Reynolds in the end credits?

What do you call the air that rushes into your car in the highway?

What is wrong with Escaped Shapeshifter's original wording?

Could a cubesat be propelled to the moon?

Offered promotion but I'm leaving. Should I tell?

Space in array system equations

How to create a hard link to an inode (ext4)?

Is "history" a male-biased word ("his+story")?

Good allowance savings plan?

A question on the ultrafilter number

How do anti-virus programs start at Windows boot?

How do you like my writing?

Should QA ask requirements to developers?

Good for you! in Russian

Force user to remove USB token

Finding algorithms of QGIS commands?

How does airport security verify that you can carry a battery bank over 100 Wh?

Make a transparent 448*448 image

How did Alan Turing break the enigma code using the hint given by the lady in the bar?

Could you please stop shuffling the deck and play already?

My story is written in English, but is set in my home country. What language should I use for the dialogue?

Could a cubesat propel itself to Mars?

Unreachable code, but reachable with exception

Word for a person who has no opinion about whether god exists



Magento 2 : Google Customer Reviews


How to setup Google Customer Reviews in Magento 2?Magento2: plugin around method not workingI created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error?Cancel the orders which are older than 3 daysWhy is overriding a block function causing template errors?Magento 2 - redirect to final checkout page (checkout success/failed)How to get last ordered product details in Magento 2.2?Magento 2.2.5: Overriding Admin Controller sales/ordermagento 2 place order programmatically from controllerMagento2 checkout/onepage/success redirects to cartMagento 2.3 Can't view module's front end page output?













3















How will final result should looks like for this implementation.
Thank you



file location: /vendor/magento/module-checkout/Controller/Onepage/Success.php



below is my default Success.php for Magento 2.1



> <?php /** * * Copyright © 2016 Magento. All rights reserved. * See COPYING.txt for license details. */ namespace MagentoCheckoutControllerOnepage;

class Success extends MagentoCheckoutControllerOnepage
/**
* Order success action
*
* @return MagentoFrameworkControllerResultInterface
*/
public function execute()

$session = $this->getOnepage()->getCheckout();
if (!$this->_objectManager->get('MagentoCheckoutModelSessionSuccessValidator')->isValid())
return $this->resultRedirectFactory->create()->setPath('checkout/cart');

$session->clearQuote();
//@todo: Refactor it to match CQRS
$resultPage = $this->resultPageFactory->create();
$this->_eventManager->dispatch(
'checkout_onepage_controller_success_action',
['order_ids' => [$session->getLastOrderId()]]
);
return $resultPage;



............................ where do i paste this code on Success.php




<script>
window.renderOptIn = function()
window.gapi.load('surveyoptin', function()
window.gapi.surveyoptin.render(

"merchant_id": XXXXXXXXX,
"order_id": "<?php echo $order->getIncrementId() ?>",
"email": "<?php echo $order->getCustomerEmail() ?>",
"delivery_country": "<?php echo $order->getShippingAddress()->getCountryId() ?>",
"estimated_delivery_date": "YYYY-MM-DD"
);
);

</script>











share|improve this question




























    3















    How will final result should looks like for this implementation.
    Thank you



    file location: /vendor/magento/module-checkout/Controller/Onepage/Success.php



    below is my default Success.php for Magento 2.1



    > <?php /** * * Copyright © 2016 Magento. All rights reserved. * See COPYING.txt for license details. */ namespace MagentoCheckoutControllerOnepage;

    class Success extends MagentoCheckoutControllerOnepage
    /**
    * Order success action
    *
    * @return MagentoFrameworkControllerResultInterface
    */
    public function execute()

    $session = $this->getOnepage()->getCheckout();
    if (!$this->_objectManager->get('MagentoCheckoutModelSessionSuccessValidator')->isValid())
    return $this->resultRedirectFactory->create()->setPath('checkout/cart');

    $session->clearQuote();
    //@todo: Refactor it to match CQRS
    $resultPage = $this->resultPageFactory->create();
    $this->_eventManager->dispatch(
    'checkout_onepage_controller_success_action',
    ['order_ids' => [$session->getLastOrderId()]]
    );
    return $resultPage;



    ............................ where do i paste this code on Success.php




    <script>
    window.renderOptIn = function()
    window.gapi.load('surveyoptin', function()
    window.gapi.surveyoptin.render(

    "merchant_id": XXXXXXXXX,
    "order_id": "<?php echo $order->getIncrementId() ?>",
    "email": "<?php echo $order->getCustomerEmail() ?>",
    "delivery_country": "<?php echo $order->getShippingAddress()->getCountryId() ?>",
    "estimated_delivery_date": "YYYY-MM-DD"
    );
    );

    </script>











    share|improve this question


























      3












      3








      3








      How will final result should looks like for this implementation.
      Thank you



      file location: /vendor/magento/module-checkout/Controller/Onepage/Success.php



      below is my default Success.php for Magento 2.1



      > <?php /** * * Copyright © 2016 Magento. All rights reserved. * See COPYING.txt for license details. */ namespace MagentoCheckoutControllerOnepage;

      class Success extends MagentoCheckoutControllerOnepage
      /**
      * Order success action
      *
      * @return MagentoFrameworkControllerResultInterface
      */
      public function execute()

      $session = $this->getOnepage()->getCheckout();
      if (!$this->_objectManager->get('MagentoCheckoutModelSessionSuccessValidator')->isValid())
      return $this->resultRedirectFactory->create()->setPath('checkout/cart');

      $session->clearQuote();
      //@todo: Refactor it to match CQRS
      $resultPage = $this->resultPageFactory->create();
      $this->_eventManager->dispatch(
      'checkout_onepage_controller_success_action',
      ['order_ids' => [$session->getLastOrderId()]]
      );
      return $resultPage;



      ............................ where do i paste this code on Success.php




      <script>
      window.renderOptIn = function()
      window.gapi.load('surveyoptin', function()
      window.gapi.surveyoptin.render(

      "merchant_id": XXXXXXXXX,
      "order_id": "<?php echo $order->getIncrementId() ?>",
      "email": "<?php echo $order->getCustomerEmail() ?>",
      "delivery_country": "<?php echo $order->getShippingAddress()->getCountryId() ?>",
      "estimated_delivery_date": "YYYY-MM-DD"
      );
      );

      </script>











      share|improve this question
















      How will final result should looks like for this implementation.
      Thank you



      file location: /vendor/magento/module-checkout/Controller/Onepage/Success.php



      below is my default Success.php for Magento 2.1



      > <?php /** * * Copyright © 2016 Magento. All rights reserved. * See COPYING.txt for license details. */ namespace MagentoCheckoutControllerOnepage;

      class Success extends MagentoCheckoutControllerOnepage
      /**
      * Order success action
      *
      * @return MagentoFrameworkControllerResultInterface
      */
      public function execute()

      $session = $this->getOnepage()->getCheckout();
      if (!$this->_objectManager->get('MagentoCheckoutModelSessionSuccessValidator')->isValid())
      return $this->resultRedirectFactory->create()->setPath('checkout/cart');

      $session->clearQuote();
      //@todo: Refactor it to match CQRS
      $resultPage = $this->resultPageFactory->create();
      $this->_eventManager->dispatch(
      'checkout_onepage_controller_success_action',
      ['order_ids' => [$session->getLastOrderId()]]
      );
      return $resultPage;



      ............................ where do i paste this code on Success.php




      <script>
      window.renderOptIn = function()
      window.gapi.load('surveyoptin', function()
      window.gapi.surveyoptin.render(

      "merchant_id": XXXXXXXXX,
      "order_id": "<?php echo $order->getIncrementId() ?>",
      "email": "<?php echo $order->getCustomerEmail() ?>",
      "delivery_country": "<?php echo $order->getShippingAddress()->getCountryId() ?>",
      "estimated_delivery_date": "YYYY-MM-DD"
      );
      );

      </script>








      magento2 review code-generation






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 5 '17 at 6:08









      Dhiren Vasoya

      4,38751843




      4,38751843










      asked Apr 4 '17 at 17:03









      rogerroger

      146215




      146215




















          3 Answers
          3






          active

          oldest

          votes


















          1














          I think you would use the file located at or whatever the vendor/template you use



          vendor/magento/module-checkout/view/frontend/templates/success.phtml


          In which case, you would put the google code after the last in the success.phtml file






          share|improve this answer
































            0














            You need to put this code in vendor/magento/module-checkout/view/frontend/templates/success.phtml.



            <?php
            /**
            * Copyright © Magento, Inc. All rights reserved.
            * See COPYING.txt for license details.
            */

            // @codingStandardsIgnoreFile

            ?>
            <?php /** @var $block MagentoCheckoutBlockOnepageSuccess */ ?>
            <div class="checkout-success">
            <?php if ($block->getOrderId()):?>
            <?php if ($block->getCanViewOrder()) :?>
            <p><?= __('Your order number is: %1.', sprintf('<a href="%s" class="order-number"><strong>%s</strong></a>', $block->escapeHtml($block->getViewOrderUrl()), $block->escapeHtml($block->getOrderId()))) ?></p>
            <?php else :?>
            <p><?= __('Your order # is: <span>%1</span>.', $block->escapeHtml($block->getOrderId())) ?></p>
            <?php endif;?>
            <p><?= /* @escapeNotVerified */ __('We'll email you an order confirmation with details and tracking info.') ?></p>
            <?php endif;?>

            <?= $block->getAdditionalInfoHtml() ?>

            <div class="actions-toolbar">
            <div class="primary">
            <a class="action primary continue" href="<?= /* @escapeNotVerified */ $block->getContinueUrl() ?>"><span><?= /* @escapeNotVerified */ __('Continue Shopping') ?></span></a>
            </div>
            </div>
            </div>
            <script>
            window.renderOptIn = function()
            window.gapi.load('surveyoptin', function()
            window.gapi.surveyoptin.render(

            "merchant_id": XXXXXXXXX,
            "order_id": "<?php echo $order->getIncrementId() ?>",
            "email": "<?php echo $order->getCustomerEmail() ?>",
            "delivery_country": "<?php echo $order->getShippingAddress()->getCountryId() ?>",
            "estimated_delivery_date": "YYYY-MM-DD"
            );
            );

            </script>




            share






























              -1














              app/design/frontend/magento/theme/Magento_Checkout/templates/success.phtml



              Add this script



              <script>

              window.renderOptIn = function()

              window.gapi.load('surveyoptin', function()

              window.gapi.surveyoptin.render(



              "merchant_id": xxxxxxxxx,

              "order_id": "<?php echo $orderData->getIncrementId() ?>",

              "email": "<?php echo $orderData->getCustomerEmail() ?>",

              "delivery_country": "<?php echo $orderData->getShippingAddress()->getCountryId() ?>",

              "estimated_delivery_date": "YYYY-MM-DD"

              );

              );



              </script>





              share|improve this answer























              • This looks like code for Magento 1, not Magento 2.

                – Steve Robbins
                Nov 14 '17 at 19:27










              Your Answer








              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "479"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f167643%2fmagento-2-google-customer-reviews%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              1














              I think you would use the file located at or whatever the vendor/template you use



              vendor/magento/module-checkout/view/frontend/templates/success.phtml


              In which case, you would put the google code after the last in the success.phtml file






              share|improve this answer





























                1














                I think you would use the file located at or whatever the vendor/template you use



                vendor/magento/module-checkout/view/frontend/templates/success.phtml


                In which case, you would put the google code after the last in the success.phtml file






                share|improve this answer



























                  1












                  1








                  1







                  I think you would use the file located at or whatever the vendor/template you use



                  vendor/magento/module-checkout/view/frontend/templates/success.phtml


                  In which case, you would put the google code after the last in the success.phtml file






                  share|improve this answer















                  I think you would use the file located at or whatever the vendor/template you use



                  vendor/magento/module-checkout/view/frontend/templates/success.phtml


                  In which case, you would put the google code after the last in the success.phtml file







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Apr 12 '17 at 1:21









                  Rafael Corrêa Gomes

                  4,54923264




                  4,54923264










                  answered Apr 11 '17 at 20:07









                  dawhoodawhoo

                  506322




                  506322























                      0














                      You need to put this code in vendor/magento/module-checkout/view/frontend/templates/success.phtml.



                      <?php
                      /**
                      * Copyright © Magento, Inc. All rights reserved.
                      * See COPYING.txt for license details.
                      */

                      // @codingStandardsIgnoreFile

                      ?>
                      <?php /** @var $block MagentoCheckoutBlockOnepageSuccess */ ?>
                      <div class="checkout-success">
                      <?php if ($block->getOrderId()):?>
                      <?php if ($block->getCanViewOrder()) :?>
                      <p><?= __('Your order number is: %1.', sprintf('<a href="%s" class="order-number"><strong>%s</strong></a>', $block->escapeHtml($block->getViewOrderUrl()), $block->escapeHtml($block->getOrderId()))) ?></p>
                      <?php else :?>
                      <p><?= __('Your order # is: <span>%1</span>.', $block->escapeHtml($block->getOrderId())) ?></p>
                      <?php endif;?>
                      <p><?= /* @escapeNotVerified */ __('We'll email you an order confirmation with details and tracking info.') ?></p>
                      <?php endif;?>

                      <?= $block->getAdditionalInfoHtml() ?>

                      <div class="actions-toolbar">
                      <div class="primary">
                      <a class="action primary continue" href="<?= /* @escapeNotVerified */ $block->getContinueUrl() ?>"><span><?= /* @escapeNotVerified */ __('Continue Shopping') ?></span></a>
                      </div>
                      </div>
                      </div>
                      <script>
                      window.renderOptIn = function()
                      window.gapi.load('surveyoptin', function()
                      window.gapi.surveyoptin.render(

                      "merchant_id": XXXXXXXXX,
                      "order_id": "<?php echo $order->getIncrementId() ?>",
                      "email": "<?php echo $order->getCustomerEmail() ?>",
                      "delivery_country": "<?php echo $order->getShippingAddress()->getCountryId() ?>",
                      "estimated_delivery_date": "YYYY-MM-DD"
                      );
                      );

                      </script>




                      share



























                        0














                        You need to put this code in vendor/magento/module-checkout/view/frontend/templates/success.phtml.



                        <?php
                        /**
                        * Copyright © Magento, Inc. All rights reserved.
                        * See COPYING.txt for license details.
                        */

                        // @codingStandardsIgnoreFile

                        ?>
                        <?php /** @var $block MagentoCheckoutBlockOnepageSuccess */ ?>
                        <div class="checkout-success">
                        <?php if ($block->getOrderId()):?>
                        <?php if ($block->getCanViewOrder()) :?>
                        <p><?= __('Your order number is: %1.', sprintf('<a href="%s" class="order-number"><strong>%s</strong></a>', $block->escapeHtml($block->getViewOrderUrl()), $block->escapeHtml($block->getOrderId()))) ?></p>
                        <?php else :?>
                        <p><?= __('Your order # is: <span>%1</span>.', $block->escapeHtml($block->getOrderId())) ?></p>
                        <?php endif;?>
                        <p><?= /* @escapeNotVerified */ __('We'll email you an order confirmation with details and tracking info.') ?></p>
                        <?php endif;?>

                        <?= $block->getAdditionalInfoHtml() ?>

                        <div class="actions-toolbar">
                        <div class="primary">
                        <a class="action primary continue" href="<?= /* @escapeNotVerified */ $block->getContinueUrl() ?>"><span><?= /* @escapeNotVerified */ __('Continue Shopping') ?></span></a>
                        </div>
                        </div>
                        </div>
                        <script>
                        window.renderOptIn = function()
                        window.gapi.load('surveyoptin', function()
                        window.gapi.surveyoptin.render(

                        "merchant_id": XXXXXXXXX,
                        "order_id": "<?php echo $order->getIncrementId() ?>",
                        "email": "<?php echo $order->getCustomerEmail() ?>",
                        "delivery_country": "<?php echo $order->getShippingAddress()->getCountryId() ?>",
                        "estimated_delivery_date": "YYYY-MM-DD"
                        );
                        );

                        </script>




                        share

























                          0












                          0








                          0







                          You need to put this code in vendor/magento/module-checkout/view/frontend/templates/success.phtml.



                          <?php
                          /**
                          * Copyright © Magento, Inc. All rights reserved.
                          * See COPYING.txt for license details.
                          */

                          // @codingStandardsIgnoreFile

                          ?>
                          <?php /** @var $block MagentoCheckoutBlockOnepageSuccess */ ?>
                          <div class="checkout-success">
                          <?php if ($block->getOrderId()):?>
                          <?php if ($block->getCanViewOrder()) :?>
                          <p><?= __('Your order number is: %1.', sprintf('<a href="%s" class="order-number"><strong>%s</strong></a>', $block->escapeHtml($block->getViewOrderUrl()), $block->escapeHtml($block->getOrderId()))) ?></p>
                          <?php else :?>
                          <p><?= __('Your order # is: <span>%1</span>.', $block->escapeHtml($block->getOrderId())) ?></p>
                          <?php endif;?>
                          <p><?= /* @escapeNotVerified */ __('We'll email you an order confirmation with details and tracking info.') ?></p>
                          <?php endif;?>

                          <?= $block->getAdditionalInfoHtml() ?>

                          <div class="actions-toolbar">
                          <div class="primary">
                          <a class="action primary continue" href="<?= /* @escapeNotVerified */ $block->getContinueUrl() ?>"><span><?= /* @escapeNotVerified */ __('Continue Shopping') ?></span></a>
                          </div>
                          </div>
                          </div>
                          <script>
                          window.renderOptIn = function()
                          window.gapi.load('surveyoptin', function()
                          window.gapi.surveyoptin.render(

                          "merchant_id": XXXXXXXXX,
                          "order_id": "<?php echo $order->getIncrementId() ?>",
                          "email": "<?php echo $order->getCustomerEmail() ?>",
                          "delivery_country": "<?php echo $order->getShippingAddress()->getCountryId() ?>",
                          "estimated_delivery_date": "YYYY-MM-DD"
                          );
                          );

                          </script>




                          share













                          You need to put this code in vendor/magento/module-checkout/view/frontend/templates/success.phtml.



                          <?php
                          /**
                          * Copyright © Magento, Inc. All rights reserved.
                          * See COPYING.txt for license details.
                          */

                          // @codingStandardsIgnoreFile

                          ?>
                          <?php /** @var $block MagentoCheckoutBlockOnepageSuccess */ ?>
                          <div class="checkout-success">
                          <?php if ($block->getOrderId()):?>
                          <?php if ($block->getCanViewOrder()) :?>
                          <p><?= __('Your order number is: %1.', sprintf('<a href="%s" class="order-number"><strong>%s</strong></a>', $block->escapeHtml($block->getViewOrderUrl()), $block->escapeHtml($block->getOrderId()))) ?></p>
                          <?php else :?>
                          <p><?= __('Your order # is: <span>%1</span>.', $block->escapeHtml($block->getOrderId())) ?></p>
                          <?php endif;?>
                          <p><?= /* @escapeNotVerified */ __('We'll email you an order confirmation with details and tracking info.') ?></p>
                          <?php endif;?>

                          <?= $block->getAdditionalInfoHtml() ?>

                          <div class="actions-toolbar">
                          <div class="primary">
                          <a class="action primary continue" href="<?= /* @escapeNotVerified */ $block->getContinueUrl() ?>"><span><?= /* @escapeNotVerified */ __('Continue Shopping') ?></span></a>
                          </div>
                          </div>
                          </div>
                          <script>
                          window.renderOptIn = function()
                          window.gapi.load('surveyoptin', function()
                          window.gapi.surveyoptin.render(

                          "merchant_id": XXXXXXXXX,
                          "order_id": "<?php echo $order->getIncrementId() ?>",
                          "email": "<?php echo $order->getCustomerEmail() ?>",
                          "delivery_country": "<?php echo $order->getShippingAddress()->getCountryId() ?>",
                          "estimated_delivery_date": "YYYY-MM-DD"
                          );
                          );

                          </script>





                          share











                          share


                          share










                          answered 2 mins ago









                          Dhaduk MiteshDhaduk Mitesh

                          662218




                          662218





















                              -1














                              app/design/frontend/magento/theme/Magento_Checkout/templates/success.phtml



                              Add this script



                              <script>

                              window.renderOptIn = function()

                              window.gapi.load('surveyoptin', function()

                              window.gapi.surveyoptin.render(



                              "merchant_id": xxxxxxxxx,

                              "order_id": "<?php echo $orderData->getIncrementId() ?>",

                              "email": "<?php echo $orderData->getCustomerEmail() ?>",

                              "delivery_country": "<?php echo $orderData->getShippingAddress()->getCountryId() ?>",

                              "estimated_delivery_date": "YYYY-MM-DD"

                              );

                              );



                              </script>





                              share|improve this answer























                              • This looks like code for Magento 1, not Magento 2.

                                – Steve Robbins
                                Nov 14 '17 at 19:27















                              -1














                              app/design/frontend/magento/theme/Magento_Checkout/templates/success.phtml



                              Add this script



                              <script>

                              window.renderOptIn = function()

                              window.gapi.load('surveyoptin', function()

                              window.gapi.surveyoptin.render(



                              "merchant_id": xxxxxxxxx,

                              "order_id": "<?php echo $orderData->getIncrementId() ?>",

                              "email": "<?php echo $orderData->getCustomerEmail() ?>",

                              "delivery_country": "<?php echo $orderData->getShippingAddress()->getCountryId() ?>",

                              "estimated_delivery_date": "YYYY-MM-DD"

                              );

                              );



                              </script>





                              share|improve this answer























                              • This looks like code for Magento 1, not Magento 2.

                                – Steve Robbins
                                Nov 14 '17 at 19:27













                              -1












                              -1








                              -1







                              app/design/frontend/magento/theme/Magento_Checkout/templates/success.phtml



                              Add this script



                              <script>

                              window.renderOptIn = function()

                              window.gapi.load('surveyoptin', function()

                              window.gapi.surveyoptin.render(



                              "merchant_id": xxxxxxxxx,

                              "order_id": "<?php echo $orderData->getIncrementId() ?>",

                              "email": "<?php echo $orderData->getCustomerEmail() ?>",

                              "delivery_country": "<?php echo $orderData->getShippingAddress()->getCountryId() ?>",

                              "estimated_delivery_date": "YYYY-MM-DD"

                              );

                              );



                              </script>





                              share|improve this answer













                              app/design/frontend/magento/theme/Magento_Checkout/templates/success.phtml



                              Add this script



                              <script>

                              window.renderOptIn = function()

                              window.gapi.load('surveyoptin', function()

                              window.gapi.surveyoptin.render(



                              "merchant_id": xxxxxxxxx,

                              "order_id": "<?php echo $orderData->getIncrementId() ?>",

                              "email": "<?php echo $orderData->getCustomerEmail() ?>",

                              "delivery_country": "<?php echo $orderData->getShippingAddress()->getCountryId() ?>",

                              "estimated_delivery_date": "YYYY-MM-DD"

                              );

                              );



                              </script>






                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Jun 7 '17 at 12:56









                              Jyoti ThakurJyoti Thakur

                              1




                              1












                              • This looks like code for Magento 1, not Magento 2.

                                – Steve Robbins
                                Nov 14 '17 at 19:27

















                              • This looks like code for Magento 1, not Magento 2.

                                – Steve Robbins
                                Nov 14 '17 at 19:27
















                              This looks like code for Magento 1, not Magento 2.

                              – Steve Robbins
                              Nov 14 '17 at 19:27





                              This looks like code for Magento 1, not Magento 2.

                              – Steve Robbins
                              Nov 14 '17 at 19:27

















                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Magento Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f167643%2fmagento-2-google-customer-reviews%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Nidaros erkebispedøme

                              Birsay

                              Where did Arya get these scars? Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara Favourite questions and answers from the 1st quarter of 2019Why did Arya refuse to end it?Has the pronunciation of Arya Stark's name changed?Has Arya forgiven people?Why did Arya Stark lose her vision?Why can Arya still use the faces?Has the Narrow Sea become narrower?Does Arya Stark know how to make poisons outside of the House of Black and White?Why did Nymeria leave Arya?Why did Arya not kill the Lannister soldiers she encountered in the Riverlands?What is the current canonical age of Sansa, Bran and Arya Stark?