1

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
Rahul Bharadwaj
  • 2,555
  • 2
  • 18
  • 29
Sopheak Sek
  • 152
  • 1
  • 8

1 Answers1

1

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
Sopheak Sek
  • 152
  • 1
  • 8
  • Just as a note, use the "lastx" format for getting a date range, it's significantly faster on larger databases than the "datex,datey" format. – Jolly Jan 01 '19 at 05:21
  • Using Mamoto just to get the pageview is really inefficient. It is slow and takes too much space for the simple task. Rather quickly build an app that do that specifically as an alternative. – Sopheak Sek Jan 07 '19 at 14:54