Hello, we’re attempting to implement ecommerce tracking through the API and the documentation is either incorrect or not very helpful.
From what I can understand from the docs, ecommerce tracking involves two steps: 1) adding an item to a cart, 2) completing the transaction.
But the API documentation isn’t clear about that. So we implemented two functions in our software: Started and Completed.
Our Started request to the API is as follows:
{"idsite":1,"rec":1,"idgoal":0,"url":"http://localhost:3000/account/my-profile","ua":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0","uid":"test1@example.com","ec_items":"%5B%5B%22thirty_day%22%2C%2230%20Day%20Membership%22%2C%22Membership%22%2C29.99%2C1%5D%5D","ec_st":29.99,"ec_tx":false,"ec_sh":false,"ec_dt":false,"revenue":29.99,"send_image":0,"apiv":1}
Where our completed is:
{"idsite":1,"rec":1,"idgoal":0,"url":"http://localhost:3000/account/my-profile","ua":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0","uid":"test1@example.com","ec_items":"%5B%5B%22thirty_day%22%2C%2230%20Day%20Membership%22%2C%22Membership%22%2C29.99%2C1%5D%5D","ec_id":"d53e068b-2e21-4fa6-b47d-a8d1d66f65fc","ec_st":29.99,"ec_tx":false,"ec_sh":false,"ec_dt":false,"revenue":29.99,"send_image":0,"apiv":1}
This is after a lot of troubleshooting and adding fields that the documentation says are optional, but do not appear to be. The deciding factor that seems to distinguish “adding” to “completing” is including the “revenue” field.
This works mostly, but it’s not recording any detail of the transactions (sku, item name, etc). Only the total amount of each transaction. We’re at a loss as to how to proceed so that we record each transaction including its items.
The documentation we’ve looked at is conflicting as to which fields to include in each request:
https:// developer. matomo. org/api-reference/tracking-api
https:// matomo. org/faq/reports/advanced-manually-tracking-ecommerce-actions-in-matomo/
https:// matomo. org/faq/how-to/measure-100-of-ecommerce-interactions-using-server-side-tracking/
Any clarification/help is appreciated.
1 post - 1 participant