Reopening, for few questions and reminders:
This was largely Xaver's code. I've updated the docs and opened a new ticket for the outstanding questions/ideas.
Replying to matt:
- Why does the snippet on the doc doesn't contain the "https:" == document.location.protocol test? Is it relying on the browser to understand that //PIWIK_URL will load with the right protocol?
I've changed it to use the old code so that it's clearer. But it is a clever optimization. The URI spec contains rules to resolves URI references. In this case, it should use the document's base URI to determine the scheme, if not specified.
- why is 'script' passed as a parameter to the anonymous function rather than harcoded in the 2 places it is used? It saves character space, but it isn't really a parameter as such... (same with the 'document' parameter?).
To save bytes. I've removed the parameters.
- Should we make the asynchronous version the default one in the UI (during install and in the SitesManager)?
- Documentation could clarify at the start that 2 distinct Tracking techniques exist. Not sure how we should organize it.
Opening a new ticket for these.
Replying to vipsoft:
In this case, it should use the document's base URI to determine the scheme, if not specified.
"it" == a conforming user agent.
Thanks for the updates, looks good!