Though SharePoint includes some analytic features, many still prefer to use third-party web analytics providers such as Google Analytics. These analytics providers use a snippet of JavaScript code that is added to each page in most cases.
In this recipe, we will create a settings page to allow site collection administrators to store the JavaScript code on a per site collection basis.
We should have already created our Visual Studio project in the Creating a Visual Studio solution for custom delegate controls recipe of this chapter before starting this recipe.
Follow these steps to create a settings page for our tracking code:
Open the project created in the Creating a Visual Studio solution for custom-delegate controls recipe of this chapter in Visual Studio.
Add a new Application Page item to the subfolder we created in the
Layouts
mapped folder as shown in the following screenshot:In the
ASPX
page...