Piwik API setVisitorId not stores into DB

Hi,

I have integrated piwik with use of php API and it works OK except one think which is custom id not stores into database, piwik generates its own “setVisitorId” code. my code is:


$t = new PiwikTracker( 2, 'http://site.com/piwik');
$t->setTokenAuth( 'codes' );
$t->setIp( $_SERVER['REMOTE_ADDR'] );
$t->doTrackPageView($page_id);
$t->setUrl( "http://".$_SERVER[HTTP_HOST].$_SERVER[REQUEST_URI] );

                     $t->setVisitorId( "66200c7d6e4ec962" );
$t->setUserAgent( @$_SERVER['HTTP_USER_AGENT']);
$t->setBrowserLanguage(@$_SERVER['HTTP_ACCEPT_LANGUAGE']);

please let me know what could be the reason for this.

Thanks in advance.

hi

did you resolve this issue?

piwik (1.12) keeps assigning the visits to servers-ip and not the visitor set with setVisitorId

what exact code do you use? it should work if calling setVisitorId() and setTokenAuth() to authenticate, in 1.12 release ?

right,

last night I figured out the setTokenAuth.

The manual depicts that the setTokenAuth is required for the setip so I added both setIp and setTokenAuth on the fly solving the setVisitorId.

Later I found a remark about setTokenAuth required for setVisitorId in the code of the PiwikTracker.php the quide didn’t mention that or I missed it

There is still something odd, I have blocked my webclient thru the dashboard using a cookie. Pageviews do not show up ( in the real time visitors widget) however ‘goals’ set using PiwikTracker do show up with the webservers ip address (79.170). Even with the ip set to the clients one (84.84)

PiwikTracker request:
piwik.php?idsite=34&rec=1&apiv=1&r=004848&cip=84.84.0.0&cid=7ef21d3a0d155061&token_auth=abcdef&idgoal=1&revenue=0.01&cookie=
see attachment for visitors log. [attachment 1301 Piwik.png]

thanks for your time

regards