-
-
Notifications
You must be signed in to change notification settings - Fork 25
Ecommerce tracking
Thomas Steur edited this page Jul 27, 2021
·
1 revision
If ecommerce tracking is enabled, then in https://github.com/matomo-org/matomo-for-wordpress/blob/4.3.1/classes/WpMatomo.php#L229-L245 we automatically register hooks for some different ecommerce systems.
We mostly support tracking product views, cart updates and orders according to our Ecommerce user guide.
Technically for the ecommerce tracking we either
- Generate a JS tracking code to track this data and print it in the HTML of the page. You can inspect and see this tracking request in the browser developer tools and the JS tracking code in the HTML of the page.
- or if a card or order is done using an ajax request then the tracking request is sent server side using PHP see https://github.com/matomo-org/matomo-for-wordpress/blob/4.3.1/classes/WpMatomo/Ecommerce/Base.php#L88-L114 . The request is created using the AjaxTracker. The actual request is sent here using wp_remote_request. If there is any error during the server side tracking, then an error will be logged and visible in the system report. You cannot see this tracking code in the browser developer tools as it's sent from the server.