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?
Here’s an example of a request you can send to disable session ID in the API: https://<account_name>.piwik.pro/api/tracker/v2/settings/app/<app_uuid> (replace account name and app uuid with the right values).
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 https://example.piwik.pro/api/tracker/v2/settings/app/<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.
@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.