This extension aims to solve the problem of discrepancies between Magento revenue reports and the revenue reports in Google Analytics.
Another reason why this problem arises is that people decide to pay at a later point in time through a different platform (like the PSP's), using a link in an email for example.
composer require elgentos/serversideanalytics2 bin/magento setup:upgrade
- This extension disables the JS Purchase Event on the success page altogether. It will however track the pageview.
- This extension only tracks paid orders (it fires on sales_order_payment_pay). Non-paid orders will never show up in Analytics. This is our current clients' use case, mileage may differ. PR's for code to also track non-paid orders are welcomed.
- Compatible with UA Measurement Protocol and GA4 Measurement Protocol;
- Debugging is enabled when Magento is in developer mode. See
var/log/system.logfor the log;
- Exceptions will be logged to
- The products in the payload are retrieve on invoice-basis, not on order-basis;
- An event has been added for you to add or overwrite custom fields to products in the purchase event;
- An event has been added for you to add or overwrite custom fields to transaction data in the purchase event;
- An event has been added for you to add or overwrite fields to tracking data in the purchase event;
- Testing can be done by dispatching
\Magento\Sales\Order\Payment) object in the payload;