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