Adding Google Analytics to your Directory
October 4th, 2007 by MackI decided to add Google Analytics to Lobo Links so I could track day to day failure or success. It is too soon to tell which, lol.
The New Google Analytics
Google Analytics has been re-designed to help you learn even more about where your visitors come from and how they interact with your site.
Discover. Share. Act.The new Google Analytics makes it easy to improve your results online. Write better ads, strengthen your marketing initiatives, and create higher-converting websites. Google Analytics is free to all advertisers, publishers, and site owners.
If you do not have a Google account you can get one by signing up here. During the signup process it will ask you to enter a domain name. It is fairly straight forward.
One of the last screens is a snipplet of javascript you must add to your website in order for Google to track information. Should look something like this
-
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
-
</script>
-
<script type="text/javascript">
-
_uacct = "UA-2738661-1";
-
urchinTracker();
-
</script>
This code needs to be placed in your current themes footer.tpl just before the closing body tag.
To add javascript to a smarty template. You must use what is called a literal. This is most important.
{literal}
{literal} tags allow a block of data to be taken literally. This is typically used around javascript or stylesheet blocks where curly braces would interfere with the template delimiter syntax. Anything within {literal}{/literal} tags is not interpreted, but displayed as-is.
So open footer.tpl in your favorite editor and find
-
</body>
On a new line above add
-
{literal}<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
-
</script>
-
<script type="text/javascript">
-
_uacct = "UA-2738661-1";
-
urchinTracker();
-
</script>{/literal}
Be sure to replace my analytics code with yours and now you are ready to finish the Google Analytics setup.
Related Post
- Add a Working Mixx Bookmark Icon to the Blogger/Blogspot Platform : Classic or Custom Templates - It literally took me about 2 hours to figure out the syntax for blogspot. I have no idea how people put up with that compared to a self-hosted ...
- BlogRolled, A New Revenue Outlet for Blogs? - BlogRolled is a new service to help bloggers generate cash and help advertisers gain reach and links for their website. It seems like I heard a ...
- CSS Image Replacement, The How To - CSS Image replacement is very affective for style sheet based themes. The advantage of using image replacement is compatibility for screen readers or ...















By Coolseller on Oct 8, 2007 | Reply
Very nice,
thanks for sharing.