Posts Tagged ‘typo3 template’

Monitor Traffic to Typo3 Site with Google Analytics

Friday, February 12th, 2010

There are a lot of great scripts out there for people who want to set up their own site, but not all of them are quite as expandable as the Typo3 Content Management System (CMS). Most CMS installations are going to require the person running the site to make a decision between flexibility or power and the ever important ‘ease of use’ factor. When you need to be able to create a strong site and you don’t care to become an expert programmer in order to do it, then system Typo3 is a great alternative to look into. They already have over 300,000 sites running this open source software and there are several thousand extensions (known as mods in most other CMS’s) so there’s a wide range of possibilities for your site.

Now, if you are going to go through the effort to  set up a site in Typo3, you really do want to be able to tell how effective it is at drawing people in to visit it. That’s why you are going to want to take advantage of visitor tracking through Google Analytics. This is also free for you to use and is going to help you figure out which Typo3 template your users respond best to, what content they like reading, where they came from and where they went when they left your site. Overall, Typo3 and Google Analytics are a great combination which is exactly what we want to show you how to set up right now.

This guide assumes you already have 1) a Google Analytics account and 2) an already set up installation of the Typo3 CMS.

Ready to begin? Let’s start with the editing. You are going to need to go into the Setup area of the the main template you usually use, the root template. After the last line of TypoScript, paste in this code:

page.wrap (
| <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-xxxxxx-x”);
pageTracker._initData();
pageTracker._trackPageview();
</script>
)

Of course, the “UA-xxxxxx-x” will need to be filled in with your own tracking code that is given to you by Google Analytics. Once you have done this, save your changes and Google’s Analytics is now tracking your website. Do remember that Analytics only reports every 24 hours so don’t drive yourself crazy checking the stats, a very common newbie mistake when it comes to using Analytics.

While this bit of code pasting is all you actually need, if you want optimum results with your tracking then either realURL or even simulateStaticDocuments should be configured in your Typo3 installation. That is what will give you better statistics that are going to be more useful to you in the long run as you monitor the traffic coming to your site.

Keep in mind that the purpose and power of Analytics is that it is going to give you very good SEO (Search Engine Optimization) information such as which search engines your users are coming in on, what keywords they typed in to find your site and how long they stayed. Those who want to really establish their site as a leader in its given field really benefit from this sort of insight into their visitors. If that sounds like you, then Typo3 and Google Analytics are definitely a match made in webmaster heaven.

Popularity: 5% [?]