Technology Tools for Ministry

Community

Web-Empowered Church Developer's Community
All Categories > Developers > Templates > google analytics
Total Posts: 5 - Pages (1): [1]
user picture Author: Michael Murphy-McCarthy
Posted: Oct 29 2007 - 12:13 PM
Subject: google analytics
We host a few sites that all use the same customized template, and are individualized through CSS and typo3 script. I've started using Google Analytics and put the required Google code in the template. Unfortunately this lumps the analytics for all of our sites together. We'd like to have separate analytics for each site. Any ideas on how to do this since all of the sites share the same template?
Author: Barbara Bowser
Posted: Oct 29 2007 - 12:41 PM
Subject: re: google analytics
Hey Michael,

The way we have done it for our sites is to include the Google Analytics code through the page.headerData typoscript in the Typoscript template, rather than in the HTML template. So, for your main site you'd have in the TS template setup field:

page.headerData.57 = HTML
page.headerData.57.value = <<Google Analytics code ... no line breaks>>


and for the other sites, you'd include their specific code in the same way on their top-level page Typoscript template.

Just make sure the headerData."xx" number is not one that is already being used in your Typoscript template. That number will need to be the same across your TS templates, however, if your sites are set up as sub-sites of the main site, so that the data will be overwritten in the HTML that is outputted. It's confusing to explain so if that doesn't make sense, let me know!

If you need more detail let me know.

Thanks,
Barbara
Author: Jeff Segars
Posted: Oct 29 2007 - 12:56 PM
Subject: re: google analytics
I haven't used it myself, but there's also the Google Analytics extension at http://typo3.org/extensions/repository/view/m1_google_analytics/1.5.0/.

Barbara, have you tried it before or always gone the headerData route?

Thanks,
Jeff
Author: Barbara Bowser
Posted: Oct 29 2007 - 01:29 PM
Subject: re: re: google analytics
I have not tried the extension. Wasn't aware there was one

Barbara
user picture Author: Michael Murphy-McCarthy
Posted: Oct 30 2007 - 11:04 PM
Subject: re: google analytics
Barbara, your code suggestion worked great. I'm now tracking two sites separately. Hooray. Thanks, Michael
Total Posts: 5 - Pages (1): [1]
You must login to post a message to this conference.