Removing IDs from URLs before tracking

Hi,

I would like to apply a filter/regex to all URLs to remove specific ids rather than query parameters before they are tracked. The URLs have two unique ids which will differ for each URL .
The URL is in the structure - http://www.example.com/example/cf5dbe8a/example-directory/123-456789/example-page
which needs to be tracked as http://www.example.com/example/example-directory/example-page

I would be grateful for any suggestions.

Thanks!
doubleH

For this I would recommend doing so in Javascript in the Piwik Tracker, rewrite the URL and then call setCustomUrl() function to set the new cleaned up URL

Thanks for replying so quickly.I will give that a go!

Hi doubleH,

were you able to achieve it? please share how? I am facing the same issue and not able to achive it through setCustomUrl.

We are rewriting as well the URLs, just like matthieu recommended. Unfortunately we can’t use then the “Overlay”-Feature:
Original URL: http://www.example.com/cf5dbe8a/example-page
Reported URL: http://www.example.com/ID/example-page

Problem in Overlays: When I’m on a page with the original link http://www.example.com/cf5dbe8a/example-page he won’t display the numbers of http://www.example.com/ID/example-page

I would need somehow a RegEx in Overlays to tell Piwik to ignore the specific IDs of links. So that Piwik Overlay does not look for http://www.example.com/cf5dbe8a/example-page but for http://www.example.com/ID/example-page in the recordings.

Any help is very much appreciated. Thank you!