When I user Data Tracking API for sending the data to Piwik PRO, how is the user id created? I am assume I will have send an id.
The example value in documentation says, I need to send an ID like this _id=257cc22df0ec483a. Do I need to send ID for both anonymous users and known users?
Hi Anil,
In general in Piwik PRO as soon as we have value which should be assigned to User ID, we use it. Regardless of wether the consent is given or not. That said, even if consent was not given and you push our function an assign User ID it will be assigned later on to the specific session.
NOTE: Invoking setUserId
won’t send any tracking request. To add User ID to tracked data, you have to call setUserId
before trackPageView. It does not have to be the first one. Another way is to send ping request with ping, after setting the User ID.
1 Like