spinbits / google-analytics-4-plugin
Spinbits Google Analytics 4 plugin for Sylius.
Installs: 3 814
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 2
Forks: 5
Open Issues: 5
Type:sylius-plugin
Requires
- php: ^8.0 || ^8.1
- ext-json: *
- spinbits/google-analytics-4-events-dto-s: ^0.9.0
- sylius/sylius: ~1.12.0 || ~1.11.0
Requires (Dev)
- behat/behat: ^3.6.1
- behat/mink-selenium2-driver: v1.6.0
- dmore/behat-chrome-extension: ^1.3
- dmore/chrome-mink-driver: ^2.7
- friends-of-behat/mink: ^1.8
- friends-of-behat/mink-browserkit-driver: ^1.4
- friends-of-behat/mink-debug-extension: ^2.0.0
- friends-of-behat/mink-extension: ^2.4
- friends-of-behat/page-object-extension: ^0.3
- friends-of-behat/suite-settings-extension: ^1.0
- friends-of-behat/symfony-extension: ^2.1
- friends-of-behat/variadic-extension: ^1.3
- hwi/oauth-bundle: ^1.1 || ^2.0@beta
- phpspec/phpspec: ^7.2
- phpstan/extension-installer: ^1.0
- phpstan/phpstan: ^1.8.1
- phpstan/phpstan-doctrine: ^1.3.13
- phpstan/phpstan-strict-rules: ^1.3.0
- phpstan/phpstan-webmozart-assert: ^1.2.0
- phpunit/phpunit: ^9.5
- polishsymfonycommunity/symfony-mocker-container: ^1.0
- sylius-labs/coding-standard: ^4.2
- sylius-labs/sylius-1-11-shim-bundle: ^1.0
- symfony/browser-kit: ^5.4 || ^6.0
- symfony/debug-bundle: ^5.4 || ^6.0
- symfony/dotenv: ^5.4 || ^6.0
- symfony/flex: ^2.2.2
- symfony/intl: ^5.4 || ^6.0
- symfony/web-profiler-bundle: ^5.4 || ^6.0
- vimeo/psalm: 5.*
This package is auto-updated.
Last update: 2024-11-20 21:38:09 UTC
README
Google Analytics 4 Enhanced ecommerce Plugin
Need help ?
Drop us a message hello@spinbits.io
Overview
This plugin is used to connect Sylius with Google Analytics 4 using Google Tag Manager (gtag.js). It integrates with all ecommerce GA4 events. Additionaly it measures page load time and post it as event to GA4.
Links
https://support.google.com/tagmanager/answer/6103696?hl=pl&ref_topic=3441530
https://developers.google.com/analytics/devguides/collection/protocol/ga4
https://ga-dev-tools.web.app/ga4/event-builder/
https://support.google.com/tagassistant/answer/10042782
https://tagassistant.google.com/
Details
It is designed based on backend Sylius events for high compatibility no matter what template your Sylius store is using.
Quickstart Installation
-
Add configuration to
config/services.yaml
with your Google Tag identificator default for all channels:spinbits_sylius_google_analytics4: id: "G-XXXXXXXXXX"
For dedicated GTag Id per channel you can pass
channels_ids
. It contains key-value array where key is channelcode
and value is assigned Google Tag identificator.spinbits_sylius_google_analytics4: id: "G-XXXXXXXXXX" channels_ids: FASHION_WEB: "G-DF1P3RRJ8S" OTHER_CHANNEL: "G-WX1RJ8SP3R"
-
Install plugin:
composer require spinbits/google-analytics-4-plugin
Develop
-
Execute
make start
-
See your browser
open localhost
You can find more examples in tests directory and in this repo: Google Analytics 4 Enhanced ecommerce Plugin
Testing
$ composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email office@spinbits.io instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.