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

XF 1.5 Adsense Implementation


I'm attempting to implement Adsense on my website, though I'm unsure where I need to put the code provided by Adsense after sign up.

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  (adsbygoogle = window.adsbygoogle || []).push({
    google_ad_client: "ca-pub-XXXXXXXXXXXXXXXX",
    enable_page_level_ads: true
EDIT: For some odd reason, the forum isn't letting me post, therefore I'll just put what I was going to post here:
Hello @NiallOG, you might find this useful:
(just add the code in the relevant template)

There are also third party add-ons that can help manage AdSense and other ads.
The code provided is specified to be "Paste it into the HTML of (website URL), right after the <head> tag.". Will it still work in the suggested templates? Also, is the code provided actually for the implementation of the adverts or simply for validation purposes?

Last edited:


Well-known member
@NiallOG yes, the ad code will work in the templates listed here:


They were specifically designed to do so.

You may also find this resource useful if you are using Adsense:


(check both the overview and the updates tab for details)

If you only wish to display ads to guests and/or some user groups, this resource is also useful: