Where do you paste the script for google Analytics in DNN 3.1.1

Last post 11-19-2005 12:58 AM by vasilis. 6 replies.

Sort Posts:

  • Where do you paste the script for google Analytics in DNN 3.1.1

    11-15-2005, 8:54 PM
    • Member
      5 point Member
    • LeeH
    • Member since 11-16-2005, 1:43 AM
    • Posts 1
    Sunday Google released Analytics  a free adword site monitor.  You are to paste

    <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> + more and some more script on the pages you want to monitor.

    I pasted it in a Text module & it does not display in view nor logging activity inside google.
    Lee Hinman

  • Re: Where do you paste the script for google Analytics in DNN 3.1.1

    11-17-2005, 10:25 AM
    • Member
      15 point Member
    • mlndnn
    • Member since 11-17-2005, 2:54 PM
    • Posts 3
    I pasted the script directly in a text module and it worked, however, it took a few hours for data to be loaded to the reports.  I bet Google Analytics is not real time reporting but rolled up periodically.

    -Mark
    WeekendLandlord.com
  • Re: Where do you paste the script for google Analytics in DNN 3.1.1

    11-17-2005, 2:33 PM
    • Member
      120 point Member
    • cali
    • Member since 10-14-2005, 9:41 PM
    • Posts 24
    It is recommended to post Google code in Head section. You can easily do it with some modules or by pasting it to your skin... but search forums. I've seen at least 5 threads on that.
  • Re: Where do you paste the script for google Analytics in DNN 3.1.1

    11-18-2005, 10:54 AM
    • Contributor
      2,985 point Contributor
    • AerosSaga
    • Member since 04-03-2004, 4:21 PM
    • Williamsport, PA
    • Posts 597
    To inject the Google JavaScript code into the header globally for all pages, you could add this to your skin file (put this code right after all the @Register page directives) and do not forget to insert your tracking code where the red text is:

    <script runat="server" language="vb">
        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Dim sb As New System.Text.StringBuilder
            sb.Append(
    Environment.NewLine & "<scr" & "ipt src=""http://www.google-analytics.com/urchin.js"" type=""text/javascript"">")
            sb.Append(
    Environment.NewLine & "</scr" & "ipt>" & Environment.NewLine)
            sb.Append("<scr" & "ipt type=""text/javascript"">" & Environment.NewLine)
            sb.Append("_uacct = ""UA-xxxxx-x"";" & Environment.NewLine)
            sb.Append("urchinTracker();" & Environment.NewLine)
            sb.Append("</scr" & "ipt>" & Environment.NewLine)
            Dim ph As System.Web.UI.WebControls.PlaceHolder
            ph = Page.FindControl("phDNNHead")
            If Not ph Is Nothing Then
                ph.Controls.Add(New System.Web.UI.LiteralControl(sb.ToString))
            End If
        End Sub
    </script>
  • Re: Where do you paste the script for google Analytics in DNN 3.1.1

    11-18-2005, 8:26 PM
    • Member
      590 point Member
    • vasilis
    • Member since 07-19-2002, 11:36 AM
    • Italy
    • Posts 118
    Can't be added in the head of Default.aspx?

    I mean the script you get from Google

    *** edit ***

    I found the answer in this thread: http://forums.asp.net/1113529/ShowPost.aspx
  • Re: Where do you paste the script for google Analytics in DNN 3.1.1

    11-19-2005, 12:25 AM
    • Contributor
      2,985 point Contributor
    • AerosSaga
    • Member since 04-03-2004, 4:21 PM
    • Williamsport, PA
    • Posts 597
    It could be you would then just have to be sure to add it back to default.aspx each time you upgraded your DNN install.
  • Re: Where do you paste the script for google Analytics in DNN 3.1.1

    11-19-2005, 12:58 AM
    • Member
      590 point Member
    • vasilis
    • Member since 07-19-2002, 11:36 AM
    • Italy
    • Posts 118

    Yeah, sure... but still not a big deal, right?

    Thanks!

Page 1 of 1 (7 items)