--- updated -
Add the following class to your app_code
public class WebsitePageBase : System.Web.UI.Page
{
public const string analyticsCode = "your script goes here..."
protected void Page_Load(Object sender, e as EventArgs)
{
ClientScript.RegisterStartupScript(Me.GetType(),"__analytics_script",analyticsCode )
}
}
and when you add a new aspx page, you must inherit from the new base class, so for example, you add default.aspx, your outer class should look like this:
public partial class _default : WebsitePageBase
{
}
source
share