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?
Community
Web-Empowered Church Developer's Community
Total Posts: 5 - Pages (1): [1]
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:
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
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>>
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
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
Barbara, have you tried it before or always gone the headerData route?
Thanks,
Jeff
I have not tried the extension. Wasn't aware there was one 
Barbara
Barbara
Barbara, your code suggestion worked great. I'm now tracking two sites separately. Hooray. Thanks, Michael
Total Posts: 5 - Pages (1): [1]
Pages
- Page Note
This page uses the CHC Forum Extension.

Author:
aim