Reputation: 703
I have a script like
<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("xx-xxxxxxx-x");
pageTracker._trackPageview();
} catch(err) {}
</script>
So how do i use it works in my site? Please help me to get the solution..
Upvotes: 0
Views: 66
Reputation: 85
Go to Appearance>Widgets and add "Custom HTML" to any of your sidebar widgets and past the code in there.
Make sure to including the:
<script>...</script>
Upvotes: 0
Reputation: 2897
<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("xx-xxxxxxx-x");
pageTracker._trackPageview();
} catch(err) {}
</script>
Add this snippet in the header.php or head.php
in your files, just before the end of the </head>
tag.
Upvotes: 1