1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Where do Install ad code

Discussion in 'XenForo Questions and Support' started by Kenneth Holland, Oct 12, 2012.

  1. Kenneth Holland

    Kenneth Holland Active Member

    Hello Everyone,

    I am putting in-text advertising on my form and my ad publisher says to insert the code before the closing body tag </body>.

    Which file or template would I do this?

    Thanks. :)

    Ken
     
  2. tenants

    tenants Well-Known Member

    What ad plublisher are you using?

    If you want to add something before the end of body, I would suggest adding it at the end of PAGE_CONTAINER template (this contains the </body>) or the footer template

    To edit the templates:

    Go to your admin control panel , select apperance >> templates

    There are also lots of places in the templates you can add ads (for instance adsense)
    Some templates include:
    Admin CP -> Appearance -> Templates ->
    ad_header
    ad_above_content
    ad_above_top_breadcrumb
    ad_below_bottom_breadcrumb
    ad_below_content
    ad_below_top_breadcrumb
    ad_forum_view_above_node_list
    ad_forum_view_above_thread_list
    ad_header
    ad_member_view_above_messages
    ad_member_view_below_avatar
    ad_member_view_sidebar_bottom
    ad_message_below
    ad_message_body
    ad_sidebar_below_visitor_panel
    ad_sidebar_bottom
    ad_sidebar_top
    ad_thread_list_below_stickies
    ad_thread_view_above_messages
    ad_thread_view_below_messages

    (just search for ad_ as the name of the template, thats what I did)

    It might also be worth looking here:
    http://xenforo.com/community/threads/idiots-guide-to-adverts.30029/
    And here:
    http://xenforo.com/community/threads/any-list-of-ad-locations.17546/

    There are also quite a few plug-ins that help you place your ads / or have solutions for Ads
    Examples:
    DigitalPoint Ad Positioning
    DigitalPoint ads (has a XenForo plugin)
    Ad Manager
    xenplaza--advertisement-on-each-category
    Amazon Affiliate Direct to Cart Auto Embed
    XenAms
    XenFX (I'm not sure if this has been released)
     
    Jake Bunce likes this.
  3. Chris D

    Chris D XenForo Developer Staff Member

    Hey Ken,

    Your best bet is the "page_container_js_body" template. It is called before the footer and quite close to the closing </body> tag.

    The page_container_js_body is usually where javascript files can be called, but as tenants says, any of the ad_ templates are suitable.
     
    tenants and Jake Bunce like this.
  4. tenants

    tenants Well-Known Member

    If its script you want to add, the page_container_js_body works ;)
     
    Chris D likes this.
  5. Kenneth Holland

    Kenneth Holland Active Member

    Does it matter where in the container?
     
  6. tenants

    tenants Well-Known Member

    That template contains script for Core XenForo functionality

    Without knowing what your script is, I would say "Yes and no" :S


    To play it safe I would add it after the </script> and contain the new script within your own <script></script> (but it's probably not necessary, as long as the script is within the script tags and doesn't interfere with the core script)
     

Share This Page