I'm testing out the Piwik JS tracker, and wanted to play about with plugins.
I've set a test page up using the async tracking code and _paq[] configuration array, and it tracks ok, but when I try to access the Piwik object for using e.g. Piwik.addPlugin(), it throws a "Piwik is not defined" javascript error./
Is it possible to access the Piwik singleton when using the async method?
EDIT:
I'm currently using the
method to insert the piwik code. Should I be using document.write instead?
I've set a test page up using the async tracking code and _paq[] configuration array, and it tracks ok, but when I try to access the Piwik object for using e.g. Piwik.addPlugin(), it throws a "Piwik is not defined" javascript error./
Is it possible to access the Piwik singleton when using the async method?
EDIT:
I'm currently using the
var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript"; g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
method to insert the piwik code. Should I be using document.write instead?