spinbits/google-analytics-4-plugin

Spinbits Google Analytics 4 plugin for Sylius.


README

image

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

  1. 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 channel code and value is assigned Google Tag identificator.

    spinbits_sylius_google_analytics4:
        id: "G-XXXXXXXXXX"
        channels_ids:
            FASHION_WEB: "G-DF1P3RRJ8S"
            OTHER_CHANNEL: "G-WX1RJ8SP3R"
  2. Install plugin:

    composer require spinbits/google-analytics-4-plugin

Develop

  1. Execute make start

  2. 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.