Hello.
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 [] = http://www.mysite.com'.
'&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 = "http://mysite.com/piwik/";
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", guid);
piwikTracker.trackPageView();
} catch( err ) {}
}
In Fire Bug I see next query:
http://mysite.com/piwik/piwik.php?
idsite=72
&url=http%3A%2F%2Fmysite.com%2F
&action_name=
&res=1280x1024
&h=12
&m=14
&s=2
&cookie=1
&urlref=
&dir=0
&fla=1
&pdf=1
&realp=0
&wma=1
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.
Thanks.
–
Best regards, Pavel.