Javascript in Plugins

I am creating multiple plugins to track additional information on my server. Some of the elements i am tracking require the use of javascript which is to be expected. Currently, i echo out the javascript that i have developed in order to glean this information. However when i get to putting it into the visitor_log table i would need to use an AJAX request to pass the information i need back to the page so i can use $visitorInfo[‘xyz’] = $_GET[‘passed_var’]. Is there a better way of doing this?

maybe you could use the javascript api function setCustomData() to pass custom data to the piwik.php script?

this is exactly what i needed, It had been a while since i had read the javascript tracking page. Maybe this should be added somewhere on the making a plugin’s page.