Access session information within Piwik PRO Tag Manager

Hi everyone,

This is probably a stupid question, but is there any way to access session information (like Session number, Channel, Source) within Piwik PRO Tag Manager, like you can with Piwik PRO API?

The idea would be to send this information to third-party services as custom variables, for example for segmentation or filtering purposes.

Is this at all possible? :thinking:

Thank you!

Hi @joao,

When it comes to the session number, you can get it using this method -

“Previous visit count” could be used but please keep in mind that visitors can clear cookies and in this case you won’t have this information

When it comes to Channel / Source you would need to write some custom logic to get these values.

Have a great day! :slight_smile:

1 Like

Hi @kamilb,

Thank you so much for your reply, I was unaware of that getVisitorInfo() method: this contains quite a lot of useful information that I can use for user segmentation (new users, returning users, past purchasers, etc.).

I know this information is dependent on the browser cookies, but given that the third-party integration doesn’t offer any user-scoped dimensions, this is already a great start!

For the channels I can always use UTM parameters in the URL and build some categories around those values. It would be nice if we could simply send whatever value Piwik PRO automatically assignes to the session, but I guess that’s wishful thinking.

Thank you again, much appreciated!