Tracking Javascripts

Hello. I want to track javascripts (widgets which get included in several websites).

At the moment I am using this snippet in the widgets:

var script = document.createElement("script");
script.setAttribute("language","JavaScript");
script.setAttribute("src","www.example.org/piwik.js");
document.body.appendChild(script);
try {
  var piwikTracker = Piwik.getTracker("www.example.org/piwik.php", 1);
  piwikTracker.setDocumentTitle(document.location);
  piwikTracker.trackPageView();
} 
catch (err) {}

As you can see this uses piwik.js, but that´s a bad idea because of the file size.
Is it possible to use a tracking pixel or anything else in this situation?

Thanks a lot.

You can, but it’s not currently documented… there is a ticket: http://dev.piwik.org/trac/ticket/653

Thanks, I have a look at it.