UA implementation has been removed.
Mainly the items from the below upgrade (1.2.0 -> 2.0.0) have been removed, as well as the remaining UA items.
Feature files have been adjusted to align with GA4. If you enable or disable specific features, please review the config. If you enable (default) all features, then there is no need to review this.
Checkout settings have been removed from the config.
CheckoutStep
constants have been moved to the CheckoutStepInterface
.
Several services/classes have been removed (because they became unused), including the cache services including their configs.
Implemented the base set-up for GA4.
Unfortunately, to keep UA & GA4 working at the same time, some breaking changes had to be made.
Mostly an extra service had to be injected, to verify whether UA or GA4 (or both) are being enabled. This service is GoogleImplementationEnabled
.
In addition, a new configuration setting is available to enable/disable UA/GA4 as you wish:
sylius_gtm_enhanced_ecommerce:
ua: true
ga4: true
On the JS side, two variables have been added which are regularly used to check whether UA/GA4 is enabled:
var gtmEnhancedEcommerceUAEnabled = '{{ sylius_gtm_enhanced_ecommerce_google_ua }}';
var gtmEnhancedEcommerceGA4Enabled = '{{ sylius_gtm_enhanced_ecommerce_google_ga4 }}';
As well these global Twig variables are available that you see being used above, they are added in a prepend
method call in the plugin Extension class.
At several locations extra services had to be injected, mainly contexts. Best is to review these if you've been overriding classes.
AddToCart and RemoveFromCart are now tracked automatically from backend without needs of javascript overrides
The services sylius.google_tag_manager_enhanced_ecommerce.cart.block_event_listener.sylius.shop.product.show.before_add_to_cart
is removed as also the twig templates and javascript associated
The checkout
event is not fired anymore on the success page because it conflicts with the 'purchase' event.
The constructor of AddTransaction
and CheckoutStep
have been modified to pass the new productIdentifierHelper
service
As we need to track only the first variant on product show page, ProductDetail twig directory has been refactored
ProductDetail/variants.html.twig
renamed toProductDetail/variant.html.twig
ProductDetail/_variant.html.twig
is removed
Adjusted PSR namespacing to follow Sylius plugin naming conventions.
- Rename namespace from
SyliusGtmEnhancedEcommercePlugin
toStefanDoorn\SyliusGtmEnhancedEcommercePlugin
The plugin has been renamed to follow Sylius plugin naming conventions.
- Rename namespace references from
GtmEnhancedEcommercePlugin
toSyliusGtmEnhancedEcommercePlugin
- Rename configuration reference from
gtm_enhanced_ecommerce
tosylius_gtm_enhanced_ecommerce
- Adjust name in
composer.json
fromstefandoorn/google-tag-manager-enhanced-ecommerce-plugin
tostefandoorn/sylius-google-tag-manager-enhanced-ecommerce-plugin
- Change parameter references starting with
gtm_enhanced_ecommerce
to start withsylius_gtm_enhanced_ecommerce