Tuesday 1 December 2009

Tuning Google Analytic for Microsoft Office Live

I found it more convenient to create an xsl style page rather than using the code lines offered on the dialogue of Office Live "Custom footer." In this way if I need some modification I modify the xsl file on my own computer and then I delete the old xsl file in the Office Live Document Gallery and I upload the new modified file in its place. I do not need to do anything on the web design. The new style automatically comes on-line. It is a good side that you do things on your own computer and then you upload them. Some people say that why the Microsoft Office Live has not its own editor and you have to delete the document and upload it again. Well, in this way I have the choice of using my own favourite editor rather than an imposed editor. I have seen when the Web Hosting Sites offer their own editors. Frequently the compiled result is not what you expect and what you intend and you have to tune things again and again. The HTML does not follow concisely the visual, for instance. You need to do much hacking. So it is better to have them in your computer with your own editor. Perhaps on the good old "notepad." For example, on the advice of Google Analytic I changed the previous style page to following
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text" omit-xml-declaration="yes"/>
<xsl:template match="/">
<![CDATA[
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-XXXXXXXX-X");
pageTracker._setDomainName(".messiahpsychoanalyst.org");
pageTracker._trackPageview();
} catch(err) {}
</script>
]]>
</xsl:template>
</xsl:stylesheet>
The modified part is in bolface letters. I used my own website domain ".messiahpsychoanalyst.org" by dropping "www" from the web address. I did that such that Google Analytic can track the inner pages of my website, too.

No comments:

Post a Comment