Importing Events Retrospectively

Hi everyone,

Is it possible to import events into Matomo retrospectively?

I’m working with a business that has a lot of offline conversions. For some of them we’ll be able to tie up a User ID to a phone call and I was wondering if there’s a way to import the result of the phone call or customer interaction into Matomo retrospectively (into the correct time in the visit log)? If I was able to pin down the Visitor ID, Session ID and Timestamp would it be possible?

I’ve trawled through the API pages and the forum but haven’t found anything, so I suspect the answer is no maybe?

Thanks for any help.

Hi there,

Yes, you can implement retrospective event tracking using the Tracking HTTP API, provided you can identify the visitor by their Visitor ID and have an accurate timestamp.

You would use the cdt parameter to specify the exact date and time the event occurred — this allows the event to be recorded as though it happened at that earlier point in time.

For example, if you had a visitorID of ddb8bb0fea95687d.

https://your-matomo-domain/matomo.php?rec=1&idsite=1
&cid=ddb8bb0fea95687d
&cdt=2025-03-06 01:22:12
&e_c=OfflineCall
&e_a=Completed
&e_n=CallWithCustomerX
&e_v=1
&url=https://example.com/offline
&token_auth=YOUR_AUTH_TOKEN

This would add an event to the existing visit.
e.g.

A token auth generated from a Super User would be required when sending a tracking request using the cdt parameter for dates older than 24hrs. The cdt would also need to be in UTC time.

More on the tracking API and the cdt parameter can be found from the following dev page - https://developer.matomo.org/api-reference/tracking-api