Set idvisitor value from a custom variable?

Hi is it possible to set the idvisitor value from a value in a custom variable ? In other words explicitly pass a userid and not have piwik generate one ?

Thanks
A

Yes, see: http://piwik.org/docs/tracking-api/reference/

You can specify the visitor ID

if you’re using JS api see feature request