Skip to content

Magento 2 module for Google Customer Reviews (GCR) Opt-In survey.

License

Notifications You must be signed in to change notification settings

aleksandar-babic/magento2-GCR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

Magento 2 module for Google Customer Reviews (GCR) Opt-In survey

How to install?

  • Clone or download this repository
  • Copy everything to //app/code
  • run php bin/magento module:enable Airslamit_Gcr
  • run php bin/magento setup:upgrade
  • run php bin/magento setup:di:compile
  • run php bin/magento setup:static-content:deploy
  • Clear all caches
  • Configure your values (values like merchant id, delivery country, etc..) in Stores -> Configuration -> Airslamit

More informations about GCR values here.

Configuration options in Stores -> Configuration -> Airslamit

Configuration values screenshot

What does this module do?

This module will add opt-in badge to your success.phtml (Order success page). Exact code that will be added is this

<!-- BEGIN GCR Opt-in Module Code -->
<script src="https://apis.google.com/js/platform.js?onload=renderOptIn"
  async defer>
</script>

<script>
  window.renderOptIn = function() { 
    window.gapi.load('surveyoptin', function() {
      window.gapi.surveyoptin.render(
        {
          // REQUIRED
          "merchant_id":"MERCHANT_ID",
          "order_id": "ORDER_ID",
          "email": "CUSTOMER_EMAIL",
          "delivery_country": "COUNTRY_CODE",
          "estimated_delivery_date": "YYYY-MM-DD",

          // OPTIONAL
          "opt_in_style": "OPT_IN_STYLE",
          "products": [{"gtin":"GTIN1"}, {"gtin":"GTIN2"}]
        }); 
     });
  }
</script>
<!-- END GCR Opt-in Module Code -->

About

Magento 2 module for Google Customer Reviews (GCR) Opt-In survey.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages