承接 webburza/sylius-google-ecommerce-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

webburza/sylius-google-ecommerce-bundle

Composer 安装命令:

composer require webburza/sylius-google-ecommerce-bundle

包简介

Sylius integration with Google's Enhanced E-Commerce tracking within Google Analytics

README 文档

README

Build Status

This bundle integrates Google's Enhanced E-Commerce (GEEC) tracking into Sylius.

Documentation

Basic installation

  1. require the bundle with Composer:

    $ composer require webburza/sylius-google-ecommerce-bundle

  2. enable the bundle:

  3. add application-specific bundle configuration

    app/config/config.yml

    webburza_sylius_google_ecommerce: key: %webburza.sylius.google_ecommerce.key%

  4. add application-specific bundle parameters (mainly, your Google Analytics key)

    app/config/parameters.yml

    webburza.sylius.google_ecommerce.key: UA-12345678-1

  5. enable GEEC block rendering in your Twig layout

    <!-- App/ShopBundle/Resources/views/layout.html.twig -->
    
        <!-- add -->
        {{ google_ecommerce_render() }}
        <!-- /add -->
        </body>
    </html>
    

Having done this properly, you should have a functional Google Analytics tracking (without the e-commerce part). You can verify it works by using Google Analytics Debugger.

Enabling the e-commerce integration

To enable the e-commerce part of the bundle, we need to tell it what the user is doing. We do this by using prepared Twig functions.

Direct action functions

These are direct responses to user doing an action.

  • {{ google_ecommerce_impression(variant, {"list": list, "position": loop.index}) }}
    mark a product impression in a listing.
    Params:
    • variant, an instance of a Sylius ProductVariant
    • list, a (string) name of the list in which the product is being displayed, ie. "search results"
    • position, the position of the product in that list, starting from 1
  • {{ google_ecommerce_details(variant) }}
    used only to indicate we're viewing a single product details view.
    Params:
    • variant, an instance of a Sylius ProductVariant
  • {{ google_ecommerce_checkout(order, {'step': 2}) }}
    indicate the progression of a checkout.
    Params:
    • order, an instance of a Sylius Order
    • step, which step are we currently on? Make sure to configure the checkout funnel, as described in the documentation.
  • {{ google_ecommerce_purchase(order) }}
    indicate a successful transaction.
    Params:
    • order, an instance of a Sylius Order

Action handler functions

These functions will render a handler which will react to user actions and invoke a direct action.

  • {{ google_ecommerce_click(variant, {"list": list}) }}
    track the click on the product in a listing.
    Params:
    • variant, an instance of a Sylius ProductVariant
    • list, a (string) name of the list in which the product is being displayed, ie. "search results"
  • {{ google_ecommerce_cart(variant, {'action': 'add', 'callable': 'function(product) {product[\'variant\'] = \'TODO: which variant?\'; return product;}'}) }}
    adding a product variant to cart.
    Params:
    • variant, an instance of a Sylius ProductVariant
    • event, the Javascript event to react to, defaults to "submit"
    • action, always "add"
    • callable, an optional Javascript callback which adds additional product information (like variant)
  • {{ google_ecommerce_cart(variant, {'event': 'click', 'action': 'remove', 'variant': item.vars.value.variant.__toString()}) }}
    removing a product from cart.
    Params:
    • variant, an instance of a Sylius ProductVariant
    • event, as we're using a hyperlink, this must be "click"
    • action, always "remove"
    • variant, as we know what's the product variant at render time, we do not need the JS callback as for the adding.
  • {{ google_ecommerce_render() }}
    render the current GEEC block. This was the function used in Basic installation.
    Params: none.

License

This bundle is available under the MIT license.

Contributing

TODO

统计信息

  • 总下载量: 728
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 23
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 20
  • Watchers: 1
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-03-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固