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

XF 1.0 Doubleclick Ad Tags: Header Code Appears At Bottom

TheBigK

Well-known member
#1
As far as I know, the header code is rendered at the bottom of the page - which (I think) makes my doubleclick ad implementation useless.

Doubleclick requires that a code to be put in the header and it *should* render at the top of page. However, I noticed that in the page source code; the code inserted in 'header' template appears at the bottom of the page and the ad-tag appears above. This prevents the ad from being displayed on pages.

Can someone help me fix this?
 

Brogan

XenForo moderator
Staff member
#2
Have you tried adding it to the page_container_js_head template?
Or the PAGE_CONTAINER template?
 

TheBigK

Well-known member
#3
Have you tried adding it to the page_container_js_head template?
Or the PAGE_CONTAINER template?
Tried. Not working :( . It seems that doubleclick header code should output on the top of the ad tags in the page in order to display the ads correctly.
 

TheBigK

Well-known member
#5
Have you tried adding it to the page_container_js_head template?
Or the PAGE_CONTAINER template?
If I insert the doubleclick header code in PAGE_CONTAINER template in 1.1, I get an error message and I can't save anything to it. It seems that the PAGE_CONTAINER rejects all extra code.

For doubleclick ads to show in pages, I must have the header code rendered *before* the actual advertisement tag in the HTML.
 

TheBigK

Well-known member
#6
Update: I get following error in the popup -

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@domain.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
 

soloarquitectura

Well-known member
#7
To us it works well in google_analytics template, by placing the code before the Google Analytics code.
We are using DFP asynchronous tags.
Brogan's solution also works fine (page_container_js_head), we have tested it.
 

Mike

XenForo developer
Staff member
#9
The ISE error is likely caused by mod_security. You can try to uncomment the lines in the .htaccess file related to this. If that does not work, you'll have to contact your host.