Server events attributed to the same visitor id


We use the piwik api to send (offline) events from our backend to sever side gtm and from there to Piwik. We collect the visitor id in the client and use this to send data to tie a offline conversion to a website visitor. All the info come in fine but everything is attributed to the same visitor id despite the _id parameter holding different values for each call. Does this have anything to do with how a session id is configured? How do I fix this?

Hi there. You have to disable Session ID in site’s settings.

But how? That means turning off consent? We’d like to have consent for setting cookies?

Ah, in this case yes. In one of the coming releases we’ll add the ability to configure it also prior to consent.

@dandan there is a workaround that doesn’t involve disabling our Consent Manager.
There is an API for data collection settings called Tracker settings API. It’s documented here in our Developers portal: Tracker Settings API — Piwik PRO Analytics Suite 18.0 documentation.

Here’s an example of a request you can send to disable session ID in the API:
https://<account_name><app_uuid> (replace account name and app uuid with the right values).


	"data": {
		"type": "tracker/settings/app",
		"id": "<app_uuid>",
		"attributes": {
			"trust_visitors_cookies": true

Make sure you’re sending the access token according to our examples here: Getting started — Piwik PRO Analytics Suite 18.0 documentation.

You can use the request collection I’m attaching to this thread (for use in Postman or Insomnia).
tracker-settings-api.json (4.3 KB)

Or alternatively, if you’re familiar with the command-line interface, another example:
curl --request PATCH \ --url<app_uuid> \ --header 'Authorization: Bearer <access_token>' \ --header 'Content-Type: application/vnd.api+json' \ --data '{ "data": { "type": "tracker/settings/app", "id": "<app_uuid>", "attributes": { "trust_visitors_cookies": true } } }'

One final note. In an upcoming release we’ll add the possibility to add a request parameter to all tracking requests sent from integrations (for example, from server-side GTM) to disable session ID on demand. Make sure to check our changelog.

1 Like

Awsome! Thanks! When do you expect this upcoming release where you add a req param to be released? Roughly?

Roughly in 2 weeks, around September 11. If nothing changes, it will be included in version 18.1 in the Changelog.

1 Like

@dandan slight correction - we’re going to take some more time working on the new request parameter. Because of that, we’ll need to move the release until September 25, so it will be included in version 18.2 of our product. Hope that’s okay with you.

1 Like