Closed indykoning closed 2 years ago
LGTM! Saw you also fixed some small bugs, nice :)
@WouterSteen you also want to take a look before I merge this in?
@indykoning I think you forget to include https://github.com/br33f/php-GA4-Measurement-Protocol as a dependency to the composer.json. The whole thing would break otherwise, right? Besides that, the changes look good to me.
The new dependency is quite new and does not support all possible events. For example, I currently work on the add_to_cart event, which is not supported. This leads to the question if it might be more clever to not rely on a third part lib, or maybe contribute to the lib.
I have to correct myself. I just saw that the add_to_cart event is supported by the lib.
@DavidLambauer he did include the GA4 protocol; https://github.com/elgentos/magento2-serversideanalytics/pull/14/files#diff-d2ab9925cad7eac58e0ff4cc0d251a937ecf49e4b6bf57f8b95aab76648a9d34R6
Wow didn't see that at all. Big yikes. Then, I'd say let's merge it. The lib seems to be fine. We'll see if it stays maintained.
:partying_face:
This PR will add an option to either enable UA, enable GA4 or enable both at the same time (although they would use the same tracking id which seems to work from the testing i've done) Config paths have been kept as is so it should not break existing installations (so long as no plugins have been made on the GAClient)
The old
Model/GAClient
had been renamed toModel/UAClient
since this is the more appropriate name, other than that it shouldn't have changed.