How to modify Google Adsense to show only to a specific group?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • GHST
    Senior Member
    • Dec 2006
    • 367
    • 4.1.x

    How to modify Google Adsense to show only to a specific group?

    I'm stoked that Google Adsense is now built into Vbulletin but I'd like to limit the ads to certain usergroups. I know you need to modify the template but I'm not sure what conditions need to be added.
  • Steve Machol
    Former Customer Support Manager
    • Jul 2000
    • 154488

    #2
    This can be done with template conditionals. Here is the online documentation for using template conditionals:



    vBulletin Conditionals Quick Tips:
    vBulletin Conditionals
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography


    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    Comment

    • GHST
      Senior Member
      • Dec 2006
      • 367
      • 4.1.x

      #3
      is there a specific part of the template I'm supposed to put the condition? I'm in the ad part but I'm not sure where to put the new part.
      Code:
      <if condition="in_array($bbuserinfo[userid], array(1,2,9,13))"></if>
      meaning that I want those 4 usergroups to see the ads and no one else.

      Comment

      • glennybee
        Senior Member
        • Feb 2008
        • 1005
        • 3.7.x

        #4
        I don't have the new adsense options enabled because I've always used adsense on my forum using the ad_location_templates.

        Wrap the conditional around the adsense code.

        Code:
        <if condition="is_member_of($bbuserinfo,1,2,9,13)">
        <!-- adsense code here -->
        </if>

        Comment

        • Nxs
          Senior Member
          • May 2004
          • 104
          • 3.0.1

          #5
          Search and ye will find

          I found this a few days ago while surfing.

          Comment

          • GHST
            Senior Member
            • Dec 2006
            • 367
            • 4.1.x

            #6
            got it.

            mods, please lock the thread.

            Comment

            widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
            Working...