How to get all the visitors one by one over REST API

Hi, I am a newbie in Piwik, trying to develop a system that tracks if visitors access to a specific page. I ve installed an instance of piwik on my local. I tried to track if visitors accessed to a specific page.

I ve added custom variables to page view or visit.


 _paq.push(['setCustomVariable','1','cv1','cv1data','visit']);
 _paq.push(['setCustomVariable','2','cv2','cv2data','visit']);
 _paq.push(['setCustomVariable','3','cv3','cv3data','page']);

and i ve added Ecommerce tracking code


 _paq.push(['trackEcommerceOrder',orderId,grandTotal,'0',
             taxAmount,shipping,false,'custom1','custom2']);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);

Now i can track number of visits on each custom variable with this code over REST API.


http://localhost/piwik/index.php?module=API&method=CustomVariables.getCustomVariables&idSite=1&period=day&date=today&format=xml&token_auth=(myToken)

the output is like this:


<result>
    <row>
        <label>cv1</label>
        <nb_uniq_visitors>5</nb_uniq_visitors>
        <nb_visits>8</nb_visits>
        <nb_actions>31</nb_actions>
        <max_actions>14</max_actions>
        <sum_visit_length>4711</sum_visit_length>
        <bounce_count>4</bounce_count>
        <goals>
            <row idgoal="ecommerceOrder">
                <nb_conversions>31</nb_conversions>
                <nb_visits_converted>14</nb_visits_converted>
                <revenue>9985</revenue>
                <revenue_subtotal>0</revenue_subtotal>
                <revenue_tax>412.3</revenue_tax>
                <revenue_shipping>155</revenue_shipping>
                <revenue_discount>0</revenue_discount>
                <items>0</items>
            </row>
        </goals>
        <nb_conversions>31</nb_conversions>
        <revenue>9985</revenue>
        <idsubdatatable>34</idsubdatatable>
    </row>
    <row>
        <label>cv2</label>
        <nb_uniq_visitors>3</nb_uniq_visitors>
        <nb_visits>8</nb_visits>
        <nb_actions>31</nb_actions>
        <max_actions>14</max_actions>
        <sum_visit_length>4711</sum_visit_length>
        <bounce_count>4</bounce_count>
        <goals>
            <row idgoal="ecommerceOrder">
                <nb_conversions>31</nb_conversions>
                <nb_visits_converted>5</nb_visits_converted>
                <revenue>9985</revenue>
                <revenue_subtotal>0</revenue_subtotal>
                <revenue_tax>412.3</revenue_tax>
                <revenue_shipping>155</revenue_shipping>
                <revenue_discount>0</revenue_discount>
                <items>0</items>
            </row>
        </goals>
        <nb_conversions>31</nb_conversions>
        <revenue>9985</revenue>
        <idsubdatatable>33</idsubdatatable>
    </row>
    <row>
        <label>cv3</label>
        <nb_actions>31</nb_actions>
        <idsubdatatable>35</idsubdatatable>
    </row>
</result>

This request returns me 3 custom variables and details of them.
How can i get all visit with detailed informations. Like in the table “log_link_conversion”

such as "visit information - related custom variables - related revenue "


<result>
    <row>   <!-- one row as one visit-->
        <sitename>x1</sitename>
		<time>t1</time>
                <revenue>r1</revenue>
		<customvar1>y1</customvar1>
		<customvar2>z1</customvar2>
		<customvar3>a1</customvar3>
		<customvar4>b1</customvar4>
					.
					.
					.
    </row>
	<row>
	        <sitename>x2</sitename>
		<time>t2</time>
                <revenue>r2</revenue>
		<customvar1>y2</customvar1>
		<customvar2>z2</customvar2>
		<customvar3>a2</customvar3>
		<customvar4>b2</customvar4>
					.
					.
					.
    </row>
	<row></row>
</result>

Best Regards,
Sinan

see the Live API

Thanks for the reply,
I had a research about Live module yesterday. I used “Live.getLastVisitsDetails” to get details of
10 visits on 1 site for a 1-day time interval. the response text (json) was 45 KB ( 1800 rows after beautify operation)
This could be a problem for large scaled live requests. Also some of fields in response are not necessary for me
(e.g. visitEcommerceStatusIcon, daysSinceLastVisit, etc.). I searched usage of “segment”

  • Is there any usage to get ony specific fields of visit details?

  • If not, I cannot find a wrapper class for live module, then I will implement a map or wrapper structure in java.
    What do you think about the ability of major changes in live module?

It would be nice to be able to specify only the fields of interest indeed. If you can create a ticket for your suggestion, then post a patch to implement the changes, we could commit it. The request could have a new parameter &columns=browser,allActions [to load actions for each visit],country,entryPageUrl
etc.?

Happy New Year! If you are still using Piwik and interested in the awesome new feature of “Creating a Custom Segment in Piwik and apply to reports in Real time!” we need YOUR help, with a little or big donation at: http://crowdfunding.piwik.org/custom-segments-editor/

This will allow to dynamically add or edit, a new set of rules for example “Show all visitors from USA and using Firefox and using Google”. This will be done via a simple to use interface. See screenshots and more info here: http://crowdfunding.piwik.org/custom-segments-editor/

We are crowd funding the future of Piwik and this feature in particular. With your help we can do it.

Thanks

Matthieu