PHPackages                             webburza/sylius-google-ecommerce-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. webburza/sylius-google-ecommerce-bundle

ActiveSymfony-bundle

webburza/sylius-google-ecommerce-bundle
=======================================

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

0.3.1(9y ago)207288[1 issues](https://github.com/webburza/sylius-google-ecommerce-bundle/issues)MITPHP

Since Feb 26Pushed 9y ago1 watchersCompare

[ Source](https://github.com/webburza/sylius-google-ecommerce-bundle)[ Packagist](https://packagist.org/packages/webburza/sylius-google-ecommerce-bundle)[ RSS](/packages/webburza-sylius-google-ecommerce-bundle/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (4)Dependencies (7)Versions (10)Used By (0)

Sylius &amp; Google Enhanced E-Commerce integration bundle
==========================================================

[](#sylius--google-enhanced-e-commerce-integration-bundle)

[![Build Status](https://camo.githubusercontent.com/412b4eb046a6f4463fcffa22eb0aae6770bd798b0a80822c4b8344a350bbe40c/68747470733a2f2f7472617669732d63692e6f72672f7765626275727a612f73796c6975732d676f6f676c652d65636f6d6d657263652d62756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/webburza/sylius-google-ecommerce-bundle)

This bundle integrates [Google's Enhanced E-Commerce](https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce) (GEEC) tracking into [Sylius](http://sylius.org/).

Documentation
-------------

[](#documentation)

### Basic installation

[](#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
    =====================

    [](#appconfigconfigyml)

    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
    =========================

    [](#appconfigparametersyml)

    webburza.sylius.google\_ecommerce.key: UA-12345678-1
5. enable GEEC block rendering in your Twig layout

    ```

        {{ google_ecommerce_render() }}

    ```

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](https://chrome.google.com/webstore/detail/google-analytics-debugger/jnkmfdileelhofjcijamephohjechhna).

### Enabling the e-commerce integration

[](#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

[](#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](https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce#measuring-checkout), as described in the documentation.
- `{{ google_ecommerce_purchase(order) }}`
    indicate a successful transaction.
    Params:
    - `order`, an instance of a Sylius `Order`

#### Action handler functions

[](#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](#basic-installation).
    Params: none.

License
-------

[](#license)

This bundle is available under the [MIT license](LICENSE).

Contributing
------------

[](#contributing)

TODO

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~44 days

Recently: every ~73 days

Total

8

Last Release

3419d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b0d2c966196cdd33799a39abc3bef8f86fca23a295a1a7894d64308a2fab609c?d=identicon)[damijank](/maintainers/damijank)

![](https://www.gravatar.com/avatar/7be35f354249944b168f250d5231af64cf86f1994205ce86df5dff8501f3c205?d=identicon)[wellwho](/maintainers/wellwho)

![](https://www.gravatar.com/avatar/4dca25dc48256f6d8546e3ccd768f039803e6719f6427e6d3ef6fc8123171648?d=identicon)[njava](/maintainers/njava)

---

Top Contributors

[![dkarlovi](https://avatars.githubusercontent.com/u/209225?v=4)](https://github.com/dkarlovi "dkarlovi (2 commits)")[![ychanan](https://avatars.githubusercontent.com/u/6249343?v=4)](https://github.com/ychanan "ychanan (2 commits)")[![Devolicious](https://avatars.githubusercontent.com/u/360302?v=4)](https://github.com/Devolicious "Devolicious (1 commits)")

---

Tags

symfonygooglesyliusecommerceanalyticse-commerceEnhancedweb.burza

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/webburza-sylius-google-ecommerce-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/webburza-sylius-google-ecommerce-bundle/health.svg)](https://phpackages.com/packages/webburza-sylius-google-ecommerce-bundle)
```

###  Alternatives

[mediafigaro/google-analytics-api-symfony

Google Analytics API v4 Symfony

46177.7k](/packages/mediafigaro-google-analytics-api-symfony)[lexik/data-layer-bundle

Manipulate the Google Tag Manager Data Layer from your Symfony application.

14114.2k](/packages/lexik-data-layer-bundle)[setono/sylius-analytics-plugin

Google Analytics plugin for Sylius

23329.6k](/packages/setono-sylius-analytics-plugin)[sylius/core-bundle

Sylius core bundle. It integrates all other bundles into full stack Symfony ecommerce solution.

22100.0k46](/packages/sylius-core-bundle)[webburza/sylius-article-bundle

Article bundle for Sylius e-commerce platform.

272.3k](/packages/webburza-sylius-article-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
