Get a twig variable


Hello there, i am a new user of piwik.
I have my website in symfony framework. I have a twig variable {{ app.user.username }}, and the variable displays th username. How can i track it on piwik? Something like

var visitor_id;
_paq.push([ function() { visitor_id = {{ app.user.username|json_encode|raw }}; }]); 

i cant figure out how to do it. Please help me.

(Matthieu Aubry) #2

myabe this blog post helps? Using Custom Variables in Piwik (Tutorial) - Analytics Platform - Matomo


I have read that article but i can figure out how to do it.