Generating (or retrieving) visitor profile ID?


#1

I’ve been reading up on the API for the new Visitor Profile feature in Piwik 2, but I’m a little confused about how the IDs work. I’m assuming that a unique cookie is generated for a visitor if one doesn’t exist, which is then tracked through their hits… but is it possible that can I generate the visitor ID’s myself and pass that ID to the tracking code, rather than Piwik generating the visitor ID, so that I can link the ID to my own member database?

The Live.getVisitorProfile API takes a visitorId but there’s no indication on how one should actually get that ID. Any advice would be appreciated.

Thanks!


(Matthieu Aubry) #2

It’s possible to set the Visitor ID yourself, but right now it’s slightly tricky to do this when using Piwik.js
It’s do-able easily using the Http tracking API.

We want to make this easy & possible, within few weeks. See this ticket Accurate User Detection cross devices: User ID (set in JS and all other clients) · Issue #3490 · matomo-org/matomo · GitHub
or consider sponsor our time to work on this if you can!