How to connect Xenforo with Google Adsense?

Sameer Memon
Sameer Memon
4 Min Read
- Advertisement -

If you started a forum with Xenforo and want to connect your forum with Google Adsense but don’t know how then this post can save you lots of time.

Here is the step-by-step solution to connect Xenforo with Google Adsense.

Let’s get straight to the solution:

The solution contains 2 parts:-

1) To get your code by adding your site to AdSense and 2) Adding that code in xenforo.

Get your Google Adsense code to connect to your forum.

- Advertisement -
  1. Go to your Google Adsense account.
  2. Go to the site section on the left
add site to adsense

3. Click on Add Site at the top right.

4. Enter your Forum Url and click save and continue.

add site in adsense

5. After clicking Save and continue you will get your Google Adsense code to connect our forum with google AdSense and allow them to place ads in any suitable place. Copy this code.

adsense code to connect your site with adsense

Copy the code by clicking the copy button.

Adding Adsense Code in Xenforo Template

6) Now login to your Xenforo Admin Panel. There are options on the left side, Go to Appearance – Template. This section contains all the blocks by which your forum is basically created.

apperance in xenforo

7) Use the search option to filter these templates. Search the query “Page”. This shall show you all the templates containing the word “page”. We are concerned with the template named “PAGE_CONTAINER”. Select to go to the editing page of the template.

- Advertisement -
page container in xenforo

Below is the sample look of the page container editing screen.

page container in xenforo

8) As instructed on the Google Adsense page, you should add your code between <head> </head> tags. Now scroll down until you reach </head> usually at the 60-70 line.

head close tag in xenforo

9) Now add your Adsense code before the </head> tag. See the below image for clarity.

code inserted in page container codes
If you cannot see this image, kindly turn off your adblocker

Now, if your forum uses only one style. You can simply click the “save and exit” button and return to your AdSense account and click “Request review”. But if your site uses more than 1 style you need to add your codes in all the styles. Click save, this will successfully add the code in the 1st style.

Now change the style by using the style selector at the top.

Now repeat the same steps and add your code just before the </head> tag for all the styles.

- Advertisement -
add adsense code in other styles in xenforo
If you cannot see this image, kindly turn off your adblocker

Once you add your codes in each style and saved it, go to your Adsense page and click the “Request review” button. Now, you have successfully connected your Xenforo forum with Google Adsense. Wait for Google to review your site. Once approved, you will be able to add ads to your forum.

Now if you don’t want auto ads in Xenforo, you can use some addons to place manual ads.

- Advertisement -
Follow:
Sameer Memon is a passionate writer with 3 years of experience in Blogging. With a strong background in Blogs, SEO, and Social Media Marketing, Sameer has been creating engaging content on various topics for a wide range of clients. As a dedicated and driven individual, Sameer takes pride in delivering well-researched and thoughtfully written articles that provide readers with valuable insights and information. He is constantly striving to stay up-to-date with the latest industry trends and techniques to produce content that is not only informative but also engaging and easy to read. When Sameer isn't busy writing, he enjoys gaming. He also loves to explore new places to gain fresh perspectives and inspiration for his writing. If you're interested in learning more about Sameer and his work, you can follow him on social media platform at give handles.