Closed loekvangool closed 1 year ago
it never tracked conversions if I remember correctly, that's something for modules like Enhanced Commerce etc.
The PR tracks page visits, convertions and events depends too much on the business logic of the website and anyway it's not to be considered a "bug" of the current implementation.
It's a serious degradation of functionality. Without conversions, Google smart campaigns fail. At the very least it should be documented.
the previous implementation (which is anyway still there) didn't track conversions either AFAIK so I don't understand the degradation...
the previous implementation (which is anyway still there) didn't track conversions either AFAIK so I don't understand the degradation...
I don't think so. I can confirm that orders are tracked with the pre-GA4 implementation. The code was already mentioned in my original post but it's here: https://github.com/OpenMage/magento-lts/blob/1.9.4.x/app/code/core/Mage/GoogleAnalytics/Block/Ga.php#L206
ok, it should be quite easy to add
I've created https://github.com/OpenMage/magento-lts/pull/3092 if you want to give it a try
Aprreciate it, I will find time for testing
https://github.com/OpenMage/magento-lts/pull/3023 implements the basic GA4 snippet from Google, but it's probably not ready for production.
I haven't run it, but by looking at the code, this PR does not implement order (conversion) tracking (
_getOrdersTrackingCode()
). Without conversion tracking, I would say that GA4 is not "ready". I think this is the right event to track: https://developers.google.com/analytics/devguides/collection/ga4/reference/events?client_type=gtag#purchaseAlso, I cannot help notice that this PR was approved without proper testing, or at least if there was testing, it was not documented in the Issue (see discussion in https://github.com/OpenMage/magento-lts/pull/3023).
In order to implement conversion tracking, something like this is needed: https://github.com/OpenMage/magento-lts/blob/1.9.4.x/app/code/core/Mage/GoogleAnalytics/Block/Ga.php#L206
Note: It seems from GA4 docs that tracking pageviews is not necessary, hence in theory
_getPageTrackingCode()
does not need to be implemented for GA4.