Google Analytics code placement

Discussion in 'vBulletin' started by Gray-Fox, Dec 18, 2010.

  1. #1
    Hello,

    I have a Vbulletin v3.8.1 forum and I would like to make the traffic tracking using google analytics,
    I know that the code must be placed before the </body> tag...
    But the VB has so many pages and files which can be edited, that Im totally confused. Do you know how and where can I add the tracking code?

    Thank you!
     
    Gray-Fox, Dec 18, 2010 IP
  2. wikivisas

    wikivisas Greenhorn

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #2
    you may place in footer file, it will automatically come before </body> tag.
     
    wikivisas, Dec 18, 2010 IP
  3. Gray-Fox

    Gray-Fox Greenhorn

    Messages:
    90
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #3
    hmmm, actually it's not </body> tag, it's </head>, so I think there must be a specific file in Vbulletin that I have to edit.
     
    Last edited: Dec 18, 2010
    Gray-Fox, Dec 18, 2010 IP
  4. wikivisas

    wikivisas Greenhorn

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #4
    1. Log in to your VB admin control panal
    2. Choose Styles & Templates from the left menu
    3. Click Styles Manager
    4. Select the drop down menu for your active style and choose Edit Templates under Template Options. (second listing down)
    5. The page will change but just hit GO next to the dropdown.
    6. 3 boxes of code appear, the third is the Footer
    7. Scroll all the way down to the end of the code in the box, and put your cursor in the box ready.
    8. Type <vb:literal>
    9. Paste your Google Analytics Code
    10. Type </vb:literal>
    11. Scroll to the bottom of the page and hit Save!
     
    wikivisas, Dec 18, 2010 IP
  5. Gray-Fox

    Gray-Fox Greenhorn

    Messages:
    90
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #5
    why do I have to type this <vb:literal>? cant I just insert the Google analytics code?
    And, this is gonna be before the </body> tag, will it work?
     
    Gray-Fox, Dec 18, 2010 IP
  6. wikivisas

    wikivisas Greenhorn

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #6
    Its because VB uses a bastardised version of the smarty engine. Without those tags the engine freaks out when interpreting javascript and other codes.
     
    wikivisas, Dec 18, 2010 IP
  7. Gray-Fox

    Gray-Fox Greenhorn

    Messages:
    90
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #7
    hmm, ok, I'll try without this VB tag, but if it doesnt work I'll add it.
    Anyways, thank you for the support!
     
    Gray-Fox, Dec 18, 2010 IP
  8. KW802

    KW802 Well-Known Member

    Messages:
    182
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    168
    #8
    The <vb:literal> tag is only applicable to vBulletin 4.0.0 & above; the OP is using vB 3.8.1 yet.

    The easiest way to do it is to simply put the GA code into your parent styles "ad_footer_end" template.
     
    KW802, Jan 3, 2011 IP
  9. www.ww1.in

    www.ww1.in Well-Known Member

    Messages:
    240
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    105
    #9
    I have put in ads manager at the header banner alongwith the ads code
     
    www.ww1.in, Jan 3, 2011 IP
  10. Gray-Fox

    Gray-Fox Greenhorn

    Messages:
    90
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #10
    Yep. That's what I did.
     
    Gray-Fox, Jan 7, 2011 IP
  11. RevJim

    RevJim Peon

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Hey guys,

    I was trying to figure out how to install a GetClicky tracking code into vBulletin and this did the trick. Thanks for the help!
     
    RevJim, Jan 7, 2011 IP
  12. decryption

    decryption Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    I installed vBSEO and put the analytics code in there, so it knows where to best place it.
     
    decryption, Feb 20, 2011 IP
  13. >>Oxygen<<

    >>Oxygen<< Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    I'd say put it in the footer.
     
    >>Oxygen<<, Mar 7, 2011 IP