O
Oltmans
Hi,
I'm still learning stuff and was just wondering how can I let other
people put some function of my JavaScript on their website so that I
can gather information from their website. Here is what I was looking
at
--
<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">
var pageTracker = _gat._getTracker("UA-3358728-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
--
This is the code that I've to put into my website so that I can use
Google Analytics, how can I go about creating the same thing in
JavaScript?
As I understand above code, and I could be flat-out wrong, is that
document.write statement in above code snippet is adding a script
named 'ga.js' to my website and that script contains an object _gat
that contains other functions. Is my understanding right? Moreover,
what does the unescape thing doing in the above code? Can the above
approach be improved?
Please enlighten me, I will really appreciate any replies.
Thanks and have a great day,
Rolf
I'm still learning stuff and was just wondering how can I let other
people put some function of my JavaScript on their website so that I
can gather information from their website. Here is what I was looking
at
--
<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">
var pageTracker = _gat._getTracker("UA-3358728-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
--
This is the code that I've to put into my website so that I can use
Google Analytics, how can I go about creating the same thing in
JavaScript?
As I understand above code, and I could be flat-out wrong, is that
document.write statement in above code snippet is adding a script
named 'ga.js' to my website and that script contains an object _gat
that contains other functions. Is my understanding right? Moreover,
what does the unescape thing doing in the above code? Can the above
approach be improved?
Please enlighten me, I will really appreciate any replies.
Thanks and have a great day,
Rolf