@anonymous-piwik-user opened this Issue on November 13th 2008

Now JavaScript code to include has document.write. It is bad to sites that has XML MIME, for example: application/xhtml+xml. I write new code that is compatible with DOM:

<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://URL_to_Piwik" : "http://URL_to_Piwik");
var head= document.getElementsByTagName('head')[0];
var s = document.createElement("script");
s.setAttribute("type", "text/javascript");
s.setAttribute("src", pkBaseURL + "piwik.js");
<script type="text/javascript">
piwik_action_name = '';
piwik_idsite = 2;
piwik_url = pkBaseURL + "piwik.php";
piwik_log(piwik_action_name, piwik_idsite, piwik_url);
Hello World
@mattab commented on November 24th 2008 Member

duplicate of #355

This Issue was closed on November 24th 2008
Powered by GitHub Issue Mirror