Can I merge data from old URL structure to new URL structure?

My site has been running for 10 years. In the middle of that period, I had a developer redesign my website, which caused a handful of URLs to change.

For example, the content that was previously hosted at the URL /comics_en/rat-park is now hosted at the URL /comic/rat-park

I needed to make that change due to the requirements of a WordPress plugin that I needed to install midway through my website’s life. I have an auto-redirect function on my server that forwards users who are trying to access the old URL to the new address (see for yourself here).

However, when I look at a Matomo report for my traffic statistics for the last 10 years, the statistics show up in 2 different locations, reflecting the two different addresses that the content has been hosted at over the years.

If the two data sources were combined, I would easily be able to see the total number of users that have visited that content over the entire life of the site, as well as aggregate data for all of the other fields such as country, duration, etc.

My question is: is there a way to adjust Matomo’s settings to merge the two sets of data into one? So that the content for the old /comics_en/rat-park/ page is combined with the data from the /comic/rat-park/ page?

I hope that this is possible, and you can tell me the way to do this. Thanks in advance!

I have no knowledge on WP.
But on Matomo, when you track data, you can change the URL:

url query parameter on the HTTP API:

setCustomUrl( string ) on the JavaScript API:

Also you can compare the page titles instead of the page URLs that could maybe be consistent during the time…