Asset listing page output pageviews


(Steven) #1

Matrix Version: 5.4.5.3
Hi,

I have an asset listing page that outputs all our live page titles, page link, when they were last edited, and by which editor.

I want to tag onto the end of each row the “Page views” which are available on the Edit+ analytics screen.
Is there a keyword replacement I could use to output page views.

I essentially want the ability to sort the order of pages by the most popular.
Any ideas?

Many Thanks
Steven


(John gill) #2

You won’t be able to get it via the Asset Listing page. The GA data that the Edit+ analytics screen uses is never stored anywhere that the asset listing page knows about.

The most straightforward approach would be to load your report Asset Listing Page and then fetch the GA data with JavaScript - probably via the getGoogleAnalyticsStatistics function on the Javascript API https://matrix.squiz.net/manuals/web-services/chapters/javascript-api#Details-Screen_google-analytics

I suspect you’re looking at 1 API call per asset (batching them would speed it up but adds a bit of complexity https://matrix.squiz.net/manuals/web-services/chapters/javascript-api#Batching-Requests), then the tying that data into the table from the Asset Listing Page would all be up to you.