1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Getting Google Analytics to work in vBulletin 4

Discussion in 'vBulletin' started by H3x, Apr 6, 2010.

  1. #1
    When trying to add Google Analytics in vBulletin 4 to a style, template or plugin the following error message may appear:

    Parse error: syntax error

    Two options of “Go Back” or “Continue” are available for selection. If you choose to forcefully save by clicking "Continue" the script doesn’t work.

    Google Analytics tracking code or script contains some special characters which does not parse properly. Thus, in order to embed Google Analytics tracking code, the easier way is to wrap the code with vb:literal tags so that the code is treated literally during page rendering.

    For example:

    <vb:literal>
    *** GOOGLE ANALYTICS CODE HERE ***
    </vb:literal>
    PHP:
    The Google Analytics tracking code can be placed in footer template, or better suggestion is to place it into ad_footer_end template (inside Ad Location Templates) as to avoid future upgrading issues where templates need to manually merged.

    Nick
     
    H3x, Apr 6, 2010 IP
  2. ~kev~

    ~kev~ Well-Known Member

    Messages:
    2,866
    Likes Received:
    194
    Best Answers:
    0
    Trophy Points:
    110
    #2
    Put the code in the footer ad location - that should fix you up.

    Also, by putting the code in the ad_footer template, your not messing with the core template files.
     
    ~kev~, Apr 7, 2010 IP
  3. BiggleJones

    BiggleJones Greenhorn

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #3
    Old post, I know...but still useful. Thanks!
     
    BiggleJones, Apr 17, 2012 IP