Pull events from Piwik(tu) by browser query

Hi!

First I’d like to say that I just started using Piwik, and so far, it’s been a fantastic experience. It does everything I want it to, and more. I am seriously considering donating now. Wonderful tool, all in all.

As for my problem:

I’m writing a javascript webapp. The app loads data based on browser query, for example: domain.com/foo?bar=12345. Once that is loaded, the domain does not change; within the scope of the webapp, the user will never leave that particular page. On the page I am tracking events (a), (b), and ©. My question is in two parts:

  1. How do I track separate browser queries as separate hits? Right now, foo?bar=12345 and foo?bar=67890 are considered to be the same visit, just on different pages. I need them to count as separate visits.

  2. How can I then pull only the statistics of event (a) occurring on foo?bar=12345, and not include results from foo?bar=67890 or any other variations?

Thank you lots in advance! Once again, this is a fantastic tool, and I hope to continue using it for a long time.

SVG

I need them to count as separate visits.

you can tell Piwik to create a new visit for a request: http://piwik.org/faq/how-to/faq_187/

How can I then pull only the statistics of event (a) occurring on foo?bar=12345, and not include results from foo?bar=67890 or any other variations?

use segmentation: http://piwik.org/docs/segmentation/
and create a segment for this URL you are interested in, it will only return pageviews matching this URL

This was exactly what I needed, thanks a lot!

Hmm… so I’ve tried the above solution, and while it’s close, it wasn’t entirely what I was looking for.

With getting Piwik to treat every request as a new visit, it’s good that it treats every URL separately – however, it also treats every action as a separate request. For me, a visit should include the URL the user hit as the very first entry, then everything underneath are custom javascript events recorded by Piwik – still counting as part of that one visit. If the user happens to refresh the page, that will count as another visit; the URL on top, then all the javascript events below it.

Thank you for the help so far. Please let me know if the solution I outlined is possible, and what I could do to achieve it.

With getting Piwik to treat every request as a new visit, it’s good that it treats every URL separately – however, it also treats every action as a separate request.

if you set the new_visit thing on each pageview then it will create a new visit on each pageview. If you don’t want to do this, simply don’t call the new_visit thing on each pageview and only call it when you want to create a new visit