How to export page title and url together using Piwik API


#1

Hello, Piwik Team. I need export the most tracked pages statistics (unique pageviews, title and url for each page) from Piwik. I’m using “Actions.getPageTitles” method of Piwik API but it export only page title and visitor details. It doesn’t export page url. I checked “Actions.getPageUrls” method too. And this method export only visitor details not page url. So, what should I do for exporting page title and url together ? Is it possible ?


(JulienM) #2

I don’t think there is a clear 1 to 1 mapping between page titles and URLs.

Multiple URLs can point to the same page title.

Mutilple titles can be attributed to the same URL when the title is changed over time.


#3

So the only method to get a list of urls with titles is like :


fetch Actions.getPageTitles
  loop labels for each title
    fetch Actions.getPageUrls

the purpose is the create a joomla/wordpress plugin to show the top pages in a given period.

I’m aware of the fact that titles might not be unique, first searching for the most frequentlty visited Urls could solve that but even van using flat=1 the urls are sorted per branch and not ‘flat’

Any suggestions?


#4

subscribe

we need the same and could’n get a clue how to manage it


#5

Hi,

I created a small script to achieve the desired list.

http://affiliatefeeds.nl/more/17-populair-posts-with-analytics.html

It’s quite basic right now and there are a few catches for exampel if pages change the title or url, but as long as the top-list is not critical it works fine.

If more poeple are interrested I can go on and improve it.


#6

nice one! many thanks … I will have a closer look to it and giv you reply how it works vor us

regards, Johannes


#7

Hi, thanks for your script! I am not sure how you are joining the title with the url, can you give more details about how is this achieved in your script? (also is not clear if your link is pointing to a correct link, currently is pointing to a post that is pointing to another page that has a link to see a php class to fetch csv data, but I can not understand how is pulling the links from the API).

Thanks in advance

[quote=brbrbr]
Hi,

I created a small script to achieve the desired list.

http://affiliatefeeds.nl/other/17-populair-posts-with-analytics.html

It’s quite basic right now and there are a few catches for exampel if pages change the title or url, but as long as the top-list is not critical it works fine.

If more poeple are interrested I can go on and improve it.[/quote]


#8

subscribed… will be very useful, sometimes is required to display the hyperlink (title and url)


#9

The script first pulls the most populair titles from piwik. Then for each title the most populair URL.

on a well organised site this should result in a fairly good represenatation of your most populair pages.

piwik is an archive so titles and URL might be outdated.


#10

Thanks so much for your help, I have reviewed the address again and now is addressing directly to a page clearly related (and I found that the script that I have reviewed is not the current script published in a .zip!). I will review/test in more detail the script in the next days.

[quote=brbrbr]
The script first pulls the most populair titles from piwik. Then for each title the most populair URL.

on a well organised site this should result in a fairly good represenatation of your most populair pages.

piwik is an archive so titles and URL might be outdated.[/quote]


#11

I just saw this post. Has there been no better way to do this yet? Haven’t seen the script yet but there must be a better way then looping through results?