• 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

#1
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
 

tenants

Well-known member
#2
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)
 

Chris D

XenForo developer
Staff member
#3
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

Well-known member
#6
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)