在Shopify自建站中添加Google客户评论功能,增加GMC排名

admin3年前网站运营612

在Shopify自建站中添加Google客户评论功能,增加GMC排名

// this code works(4 Oct 2018), it might need changes depending on if and when shopify or google changes their code)
// Paste this code carefully with in the script tags

window.renderOptIn = function() {
    window.gapi.load('surveyoptin', function() {

    //this code gets all the UPC codes for products ordered, and adds them to product array
    //skip products fields it if you are not using global identifier, it also means that your review is not co-nthrelated back to products ordered

    var products = [
      {% for item in order.line_items %}
        {
          "gtin": {{ item.variant.barcode }}
        },

      {% endfor %}

      ];

      window.gapi.surveyoptin.render(

        {

          // REQUIRED FIELDS

          "merchant_id": 12345, //replace with your own google merchant id

          "order_id": "{{order.order_number}}",

          "email": "{{order.email}}",

          "delivery_country": "{{order.shipping_address.country_code}}",

          //this date dictates when review email would be sent if customer opt in, "plus:345600" is number of seconds for 4 days. Change the number of seconds to delivery time (432000 = 5 days, 604800 = 7 days).

          "estimated_delivery_date": "{{ order.created_at | date:'%s' | plus:345600 | date:'%F' }}",

          //optional: delete this line if you are skipping product GTIN

          "products": [{% for item in order.line_items %}{"gtin":"{{ item.variant.barcode }}"}{% unless forloop.last %}, {% endunless %}{% endfor %}]

          //optional: setting to where to display the dialog(prompt customer to opt in)

          "opt_in_style": "CENTER_DIALOG"

        });

  });

}


相关文章

独立站怎么才能有订单?

要想获得订单,独立站需要做以下几件事:1.制定有效的营销策略:通过SEO、SEM、社交网络营销等方式,向目标客户推广独立站,提高曝光率。2.提升网站质量:建设符合用户体验的网站,改善产品、服务等页面,...

做流量的本质是做用户

 做流量、做用户不是一劳永逸的,必须是一个机动化、持久化、长期的运作。这就导致两个现象,A,你对于获取流量必须要有非常清晰的认识;B,你获取流量的渠道必须是多元化的。  做流量、做用户不是一...

Temu推广计划

Temu推广计划

Temu主要围绕Google、Instagram等搜索引擎和社交平台投放,北美地区的网红博主,也是重点投放对象之一。  “Temu很看重这些网红在美国和加拿大拥有的粉丝占比,这些网红会通过发布种草好物...

三只松鼠的销量为何如此高,这个秘密我猜没有人会告诉你

三只松鼠的销量为何如此高,这个秘密我猜没有人会告诉你

新零售时代,产品的包装已成为营销黑马!据官方统计,三只松鼠、良品铺子等供应商,在去年的双十一活动中,全网络渠道销售额已突破十亿元。仔细研究下这些爆款产品,如三只松鼠,不难发现一个趋势:爆品要么赢在产品...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。