We are creating several (19) sites to be hosted in Sharepoint 2007 and want to use Google Analytics. The first bit was easy, simply putting the Google Analytics javascript in the Sharepoint master page and all worked as expected.
However, we want each of the 19 sites to generate seperate statistics and this is done by having a different id for each site. My first thought was to store the id in each site's web.config and change the master page to read this for the javascript:
<%= ConfigurationManager.AppSettings["google.analytics.key"]%>
Unfortunately, Sharepoint doesn't like this and says: Code blocks are not allowed in this file.
My question is:
Is there a way to read appSettings from web.config in a Sharepoint master page? or
Is there a better, Sharepoint-way of getting site-specific information into a master page? or
Am I stuck with using seperate master pages for each of the sites?