Thanks for making the code generator, I did find it useful.
One problem, I believe the generated code is missing a forward-slash after the URL. In the top box where you can enter your URL it shows the forward slash outside the input field indicating the user should not enter a forward slash, but in the generated code it is not including the forward-slash, which I believe is necessary otherwise the code will not work (although the async2 version is correctly including the forward-slash)
Sorry for the late response. I’m busy at the moment.
Thanks for reporting the bugs - I fixed them. Unfortunately as I sad its only a quick n dirty version, but should work as expected. Maybe I can refine it later…
Because its a total client side version, feel free to copy the source code and modify it as much as you like.
I’m sorry for kicking this dead body of a forum thread, but I think it’s still is the best (and the only one so far) thread for asynchronous tracking related points.
I have following questions to the asynchronous tracking (refers to the Piwik 1.12 release):
2. Fallback Image Tracker Location
If one uses the new asynchronous tracker code, places it before the as Google suggests and wants to use the image tracker as a no-script fallback between the tags, where would you then suggest placing that image tracker code: together with the asynchronous tracker before the tag, or at its previous location (with the old synchronous tracker) before the tag?
3. Disadvantages of the Asynchronous Tracker
The advantages of the asynchronous tracking have been widely documented. But does the asynchronous tracker have any disadvantages? E.g. with legacy and/or non-mainstream (e.g. older mobile) browsers?
E.g.: It seems that, although the “async” attribute was first introduced in HTML5, the addition of the “defer” attribute to the asynchronous tracker is supposed to provide a fallback for legacy browsers (see HTML Standard) - but only if they support the “defer” (see its history in the answer to javascript - Defer Attribute (Chrome) - Stack Overflow). Otherwise the script would block the page loading.
Is there anything else to be concerned about related to the new asynchronous tracker, e.g. for very old and/or exotic browsers, e.g. DOM related issues, etc.? I.e. if they don’t already have a problem with the old synchronous tracker.
Or is the asynchronous tracker, if placed just before the at the end of the page, in the worst case (i.e. if blocking page load with legacy/non-mainstream browsers) at least as good as the old synchronous tracker, while being better in most cases (i.e. with most modern browsers; although by a negligible time difference)?