troubleshooting Question

Php track visits info via piwik (possibly via api or php piwik interface)

Avatar of Johnny
JohnnyFlag for United States of America asked on
PHPAnalytics
5 Comments1 Solution1263 ViewsLast Modified:
Id like to track views to a set of pages i have, and make a report of them. Im having trouble as there are so many ways in piwik to do this. there is an api to return info via xml or json etc. this works well to get page information as i have piwik all ready setup. i also noticed theres a way to make custom values in php via a php tracker.

So how do i implement this:
i have a page set of /single_event_page.php?id=64 where the id= is the event id of my mysql record.
example:
my_doamin/analytics/index.php?module=API&method=Actions.getPageUrl&pageUrl=/single_event_page.php?id=64&idSite=1&period=range&date=2013-12-01,2014-01-01&format=xml&token_auth=xxx

returns
<label>/single_event_page.php?id=64</label>
<nb_visits>1</nb_visits>
<nb_hits>2</nb_hits>

this works very well, but im trying to capture multi event listings page views and save them daily and a total for the month in my database

i was thinking of doing this in a  cron job at 3:30 am as that california is 3 hours off from us so all of usa hits are properly counted.
and setting up a database table Daily_Views with fields of  PAGE_ID, DATE_STAMP,UNIQUE_VIEWS, PAGE_VIEWS
and repeating for Month_Views but having DATE_STAMP being MONTH as the field

this way i can then print my report by page ID getting my event info in a joined table lookup.

so would i capture all the json data and collate to save it to mysql or is there a better way it seams with a large site of 1000's of events this would take a very long time. as id be doing on the first of each month both the prev months totals and the daily totals for that day too making all this lookup take a super long time.

if i do custom values in piwik can i just print a report with all my pages maybe and have piwik do the processing? and not have to save the info to mysql. or even make a php file that uses the api to just display my block of event pages.

some notes:
each event has an author i need to block the event page views for each page for each author ie:
John has events with id's 1,3,7
Jane has events with id's 2,4,5,6

im asking this as its very complicated to me and im not sure the best way to handle my reports of pages.

heres piwiks info as reference
http://developer.piwik.org/api-reference/reporting-api
http://developer.piwik.org/api-reference/PHP-Piwik-Tracker
http://developer.piwik.org/

thank you in advance for any code or help you may provide
Johnny
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros