Get a single page's URL metric based on its base URL, ignoring the query string

330 views Asked by At

The hit URL of a single page can be different like /post/15777, /post/15777?fbclid=xxx or /post/15777?rel=notification.

I want to get the URL /post/15777 metric (pageviews) but could not by using the API method getPageUrl in matomo api module because it would think of them as different URL.

GET /?
module=API&format=JSON&method=Actions.getPageUrl&pageUrl=/post/15777&idSite=1&period=range&date=2018-12-12,2019-12-12&token_auth=xxxxxxxxxxxxxxxxxx
1

There are 1 answers

2
Sopheak Sek On

Solved Instead of method Actions.getPageUrl with pageUrl parameter, use the Actions.get method with segment parameter of pageUrl contains a specific url segment=pageUrl=@/post/15777

GET /?module=API&format=JSON&method=Actions.get&segment=pageUrl=@/post/15777&idSite=1&period=range&date=2018-12-12,2019-12-12&token_auth=xxxxx