XF 1.3 Where to place DFP ansynchronous code?


Active member
I'm adding tags for ads using DFP for Small Business, and I'm not sure in which template to place the ansynchronous code. I found a thread where a few XF 1.0 users had success putting it in either the Google Analytics template or the page_container_js_head. Does this still work? In the Google Analytics template, someone said it needed to go before the Google Analytics code. So would it go before or after this:

<xen:if is="{$xenOptions.googleAnalyticsWebPropertyId}"><script>

If I use the page_container_js_head template, where would it go there?

Or should I put it somewhere else entirely?

Sorry if this is incredibly stupid and basic. I just have no idea.


XenForo moderator
Staff member
You can add it to either of those templates.

The FAQ in my signature has general guidance on where to add custom js.


Active member
Thank you. So it looks like you're saying I can put it anywhere in the page_container_js_head template? Can or should it be before <script src="{$jQuerySource}"></script>?