The problem with the tracking of the object

(Pavel) #1

I have a website, written because of one-application framework with the help of ExtJS.
For each object, I have the following code:

define ( 'PIWIK_ENABLE_DISPATCH', false); 
define ( 'PIWIK_ENABLE_ERROR_HANDLER', false); 

require_once __PIWIK_PATH. "/ index.php"; 
require_once __PIWIK_PATH. "/ core / API / Request.php"; 
Piwik_FrontController:: getInstance () -> init (); 

/ / We call the API from a php code 
/ / It will check that you have the necessary rights 
/ / - Either you are loggued in piwik and have a cookie in your browser 
/ / - Or you replace the token_auth = xxx to the request string to authenticate 
$request = new Piwik_API_Request ( 'method = SitesManager.addSite'. 
'&siteName ='. $ type. '_'. $ object_id. 
'&format = original'. 
'&urls [] ='. 
'&token_auth ='. __PIWIK_TOKEN_AUTH 

$newSiteId = $request->process ();

clicking on the object on the page of my site I use the following code:

tracObject: function(guid){
    try {
        var pkBaseURL = "";
        var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", guid);
    } catch( err ) {}

In Fire Bug I see next query:

If I click first time in the object - new record added on the table “piwik_log_visit”.
But if I do it again - table remains unchanged.

Please help with this problem or give me advice how to track each object on the site.


Best regards, Pavel.

(vipsoft) #2

That’s because of the recognizeVisitor code. You don’t want Piwik to overcount because someone refreshed the page in his/her browser.

Why not use piwikTracker.trackLink()?

(Pavel) #3

quote=vipsoft @ Jul 27 2009, 01:42 PM) [<{POST_SNAPBACK}>[/url]

Why not use piwikTracker.trackLink(][url=]

And now I want see, how many times object “testlink104” was clicked?
I checked DB, but there are no records, contain “testlink104”.


Best regards, Pavel.

(vipsoft) #4

There’s no built-in database logging of custom data. We might build a generic table as an example plugin, but this is inherently application-specific.

(kpv) #5

Hi to all!
I have the same problem.
I use trackPageView() - and all my clicks not logged in piwik_log_visit
I tryed use trackLink() - all clicks log in piwik_log_link_visit_action, but I can’t find widget which will display this data.