Showing posts with label Google Analytic. Show all posts
Showing posts with label Google Analytic. Show all posts
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.
<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.
Thursday, 26 November 2009
Google Analytic for Microsoft Office Live
I wondered how I can put tracking code of Google Analytic on a website designed on Microsoft Small Business Live. I found that I needed an xsl style file to embed inside my home page. I copied the tracking code offered by the Google Analytic. It is like this; it is java script:
<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._trackPageview();
} catch(err) {}
</script>
In the statement "UA-XXXXXXXX-X" the letter "X" stands for the numbers given by the Google Analytic profile for the desired website. Then I put this piece of code inside an xsl document like this
<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._trackPageview();
} catch(err) {}
</script>
]]>
</xsl:template>
</xsl:stylesheet>
The Google Analytic codes are shown as boldface fonts inside the xls template. I put this in a notepad and saved it as, say, aStyle.xsl. The extension .xsl should not be forgotten and the file format is in UTF_8. Then I upload it to my "Documents Gallery" at my Microsoft Office Live website designing console.
Now I go to my "Page Manager" page in my Microsoft Office Live console and click on "Edit" for my home page. When the "Home Page" opens in "Edit" mode I notice two tabs. I select "Page Editor" tab. There, at the top from the "Insert" pane, I click on the second icon with a drop down menu; it is the "Insert Module" menu. I move the highlight down until I get to the "Custom footer." Upon selecting this, a dialogue opens. There is an option for "Link to an xslt file" and a "Select file" button. If you select this option then it takes you directly to the "Documents gallery" where you already had uploaded your file. You can point to the mentioned "aStyle.xsl" file. Looking at the zone that you have selected for the tracking "footer," then you can see a dashed border area. That does not show anything in your site. It is, merely, the Google tracking snippet resided there. Now go to your Google Analytic and follow their instructions. It immediately informs you of being successful in installing the tracker.
<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._trackPageview();
} catch(err) {}
</script>
In the statement "UA-XXXXXXXX-X" the letter "X" stands for the numbers given by the Google Analytic profile for the desired website. Then I put this piece of code inside an xsl document like this
<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._trackPageview();
} catch(err) {}
</script>
]]>
</xsl:template>
</xsl:stylesheet>
The Google Analytic codes are shown as boldface fonts inside the xls template. I put this in a notepad and saved it as, say, aStyle.xsl. The extension .xsl should not be forgotten and the file format is in UTF_8. Then I upload it to my "Documents Gallery" at my Microsoft Office Live website designing console.
Now I go to my "Page Manager" page in my Microsoft Office Live console and click on "Edit" for my home page. When the "Home Page" opens in "Edit" mode I notice two tabs. I select "Page Editor" tab. There, at the top from the "Insert" pane, I click on the second icon with a drop down menu; it is the "Insert Module" menu. I move the highlight down until I get to the "Custom footer." Upon selecting this, a dialogue opens. There is an option for "Link to an xslt file" and a "Select file" button. If you select this option then it takes you directly to the "Documents gallery" where you already had uploaded your file. You can point to the mentioned "aStyle.xsl" file. Looking at the zone that you have selected for the tracking "footer," then you can see a dashed border area. That does not show anything in your site. It is, merely, the Google tracking snippet resided there. Now go to your Google Analytic and follow their instructions. It immediately informs you of being successful in installing the tracker.
Subscribe to:
Posts (Atom)



