Announcement

Collapse
No announcement yet.

Were do you put google Analytics Code?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Answered] Were do you put google Analytics Code?

    I want to now my traffic numbers to the forum were do I put the Google Analytics code?

    Thank you for your time.
    Learn How To Reason

  • #2
    It should be placed in the headinclude template.

    Comment


    • scylla22
      scylla22 commented
      Editing a comment
      Poor advice, you shouldn't throw JS just anywhere, especially external JS.

      When you have scripts loading in your header, they stop other downloads from taking place! This includes your styling, and will also stop your images from downloading until the script has finished.

      This is because JavaScript files load synchronously.

      Bottom line, put the JS in the footer if it can be helped.

  • #3
    Originally posted by Matthew Gordon View Post
    It should be placed in the headinclude template.
    How do I get to the "Headinclude templete" can't find it?
    Learn How To Reason

    Comment


    • #4
      Were do you put google Analytics Code?

      Goto style manager.
      Choose the style you are using
      Choose edit templates
      Add the code to the bottom of the headerinclude
      UniteTheCows - File Sharing & Digital Media Resource

      Comment


      • #5
        I placed it in Common Templates in Footer at the very end. Steve Machole helped me working really fine...

        https://www.vbulletin.com/forum/show...ogle-analytics

        Comment


        • #6
          There's a very good mod for this: http://www.vbulletin.org/forum/showthread.php?t=259340

          It will add your Analytics code automatically to all skins.
          Last edited by The Crow; Wed 25th Apr '12, 7:21pm.

          Comment


          • #7
            I pasted mine right at the very bottom of headinclude, outside of any code within the template. I also pasted into the main template theme which as many child themes set to inherit so I assume the code will be written automatically?

            How long will I have to wait to see if it has worked via Google analytics?

            Thanks
            Gran Turismo Arena The Home For GT5 Clubs & Leagues

            Comment


            • #8
              Originally posted by The Crow View Post
              There's a very good mod for this: http://www.vbulletin.org/forum/showthread.php?t=259340

              It will add your Analytics code automatically to all skins.
              I like that mod

              Originally posted by PAPPACLART View Post
              I pasted mine right at the very bottom of headinclude, outside of any code within the template. I also pasted into the main template theme which as many child themes set to inherit so I assume the code will be written automatically?

              How long will I have to wait to see if it has worked via Google analytics?

              Thanks
              If you pasted the code within a parent style it should then be in all child styles UNLESS you edited the same template in the child style beforehand (meaning it's customized within itself not from parent).

              The initial analytic report could be up to 24 hours see here - http://support.google.com/googleanal...n&answer=55541


              Former vBulletin Support Staff
              Hacked recently? See my blog post "Recovering a Hacked vBulletin Site".
              Thinking outside the box? Need modification support? Visit www.vBulletin.org and have at it!
              Need a Host? - I recommend URLJet

              Comment


              • #9
                Originally posted by mrmckoy
                Just curious... why do some people place the script in the footer versus the header? What are the benefits of such an action?
                The header and footer is present in all pages of your forum so it doesn't really matter which one your analytics code is in.

                Comment


                • scylla22
                  scylla22 commented
                  Editing a comment
                  Um wrong as per my previous comment.

                  Poor advice, you shouldn't throw JS just anywhere, especially external JS.

                  When you have scripts loading in your header, they stop other downloads from taking place! This includes your styling, and will also stop your images from downloading until the script has finished.

                  This is because JavaScript files load synchronously.

                  Bottom line, put the JS in the footer if it can be helped.

              • #10
                In the footer, it should be rendered almost last so your content will be loaded first which, in years past, would have been preferable. However the code now parses a lot faster so shouldn't really impact whether it's in the header or footer. Personally I still always favour it in the footer.
                Vote for:

                - *Admin Settable Paid Subscription Reminder Timeframe*
                -
                *PM - Add ability to reply to originator only*
                - Add Admin ability to auto-subscribe users to specific channel(s)
                - Highlight the correct navigation tab when you are on a custom page
                - "Quick Route" Interface...
                - Allow to use custom icons for individual forums

                Comment


                • #11
                  You shouldn't throw JS just anywhere, especially external JS.

                  When you have scripts loading in your header, they stop other downloads from taking place! This includes your styling, and will also stop your images from downloading until the script has finished.

                  This is because JavaScript files load synchronously.

                  Bottom line, put the JS in the footer if it can be helped. Always display JS at the footer unless it effects the placement of a visible element on the page or prevents something from loading, these are my only exceptions.

                  Here is an excerpt from Yahoo performance rule 6.

                  The second problem caused by scripts is blocking parallel downloads. The HTTP/1.1 specification suggests that browsers download no more than two components in parallel per hostname. If you serve your images from multiple hostnames, you can get more than two downloads to occur in parallel. (I've gotten Internet Explorer to download over 100 images in parallel.) While a script is downloading, however, the browser won’t start any other downloads, even on different hostnames.

                  Comment

                  Related Topics

                  Collapse

                  Working...
                  X