Book Image

SharePoint 2013 WCM Advanced Cookbook

By : JOHN CHAPMAN
Book Image

SharePoint 2013 WCM Advanced Cookbook

By: JOHN CHAPMAN

Overview of this book

Table of Contents (19 chapters)
SharePoint 2013 WCM Advanced Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Storing analytics tracking code with a site collection settings page


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.

Getting ready

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.

How to do it...

Follow these steps to create a settings page for our tracking code:

  1. Open the project created in the Creating a Visual Studio solution for custom-delegate controls recipe of this chapter in Visual Studio.

  2. Add a new Application Page item to the subfolder we created in the Layouts mapped folder as shown in the following screenshot:

  3. In the ASPX page...