Correct Way to Place Google AdSense Code in phpBB 3.2.7

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
odf
Registered User
Posts: 171
Joined: Sun Jan 22, 2017 8:55 pm

Correct Way to Place Google AdSense Code in phpBB 3.2.7

Post by odf »

I hope there are a couple of people who are implementing Google AdSense advertising program on phpBB 3.2.x or specifically, phpBB 3.2.7. So far I have tested this extension

https://www.phpbb.com/customise/db/extension/ads/ and followed instructions (from https://www.phpbb.com/customise/db/exte ... pic/184576):

First Step :

in ext/phpbb/ads/styles/all/template/phpbb_ads_default.html Remove class = "phpbb-ads-center"

Second Step : Insert your Adsense code between <div and </div> as shown below:

<div style="width:100%; max-height:100%;text-align:center">
Adsense Code
</div>

but nothing seems to work! I also noticed Google AdSense program has introduced auto Ads.

Which is the best way to implement Google advertising via AdSense in phpBB 3.2.x?
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26546
Joined: Fri Aug 29, 2008 9:49 am

Re: Correct Way to Place Google AdSense Code in phpBB 3.2.7

Post by Mick »

What instructions do you have from Google Adsense?

An extension has to be the best way.

If you’re having problems with an extension you should be asking in the dedicated discussion/support forum for the extension here.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
odf
Registered User
Posts: 171
Joined: Sun Jan 22, 2017 8:55 pm

Re: Correct Way to Place Google AdSense Code in phpBB 3.2.7

Post by odf »

Mick wrote: Tue Oct 15, 2019 1:52 pm What instructions do you have from Google Adsense?

An extension has to be the best way.

If you’re having problems with an extension you should be asking in the dedicated discussion/support forum for the extension here.
Google is instruction is always put this code (AdSense code) between <head> </head> in the html of your website.

odf
User avatar
warmweer
Jr. Extension Validator
Posts: 11268
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium
Contact:

Re: Correct Way to Place Google AdSense Code in phpBB 3.2.7

Post by warmweer »

odf wrote: Tue Oct 15, 2019 4:18 pm Google is instruction is always put this code (AdSense code) between <head> </head> in the html of your website.
Did you try it? (in overall_header.html - for the/all style(s) you're using naturally)
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
i6eal
Registered User
Posts: 4
Joined: Fri Oct 04, 2019 11:44 am

Re: Correct Way to Place Google AdSense Code in phpBB 3.2.7

Post by i6eal »

he came, he saw, he won..
My Polling-App > https://panbu.de/umfrage-app
odf
Registered User
Posts: 171
Joined: Sun Jan 22, 2017 8:55 pm

Re: Correct Way to Place Google AdSense Code in phpBB 3.2.7

Post by odf »

warmweer wrote: Tue Oct 15, 2019 4:46 pm
odf wrote: Tue Oct 15, 2019 4:18 pm Google is instruction is always put this code (AdSense code) between <head> </head> in the html of your website.
Did you try it? (in overall_header.html - for the/all style(s) you're using naturally)
I am no longer using the ext, placing the code into overall_header and index_body can at least show ads at the header and footer. The problem is when I load other than index page, ads do not show, only a blank rectangular white space is shown. I still face another problem, resizing the ads height, they are too larger, because that is how Google serves them. It also looks like ads load well with Chrome browser than other browsers such as Firefox. Try to load https://www.tssfl.com/ and check at the bottom/header and when you load for example, https://www.tssfl.com/2017-nobel-prize- ... aming-5630 you will notice the problem I described.
odf
Registered User
Posts: 171
Joined: Sun Jan 22, 2017 8:55 pm

Re: Correct Way to Place Google AdSense Code in phpBB 3.2.7

Post by odf »

i6eal wrote: Tue Oct 15, 2019 5:32 pm do it like it is described here > https://www.phpbb.com/community/viewtopic.php?t=2407796
I cant't clearly get which may be a solution to the problem I face.
User avatar
janus_zonstraal
Registered User
Posts: 6427
Joined: Sat Aug 30, 2014 1:30 pm

Re: Correct Way to Place Google AdSense Code in phpBB 3.2.7

Post by janus_zonstraal »

The problem is when I load other than index page, ads do not show, only a blank rectangular white space is shown.
Maybe Google is not showing ads on you pages, because the don't check them.
Sorry! My English is bat ;) !!!
odf
Registered User
Posts: 171
Joined: Sun Jan 22, 2017 8:55 pm

Re: Correct Way to Place Google AdSense Code in phpBB 3.2.7

Post by odf »

janus_zonstraal wrote: Tue Oct 15, 2019 9:02 pm
The problem is when I load other than index page, ads do not show, only a blank rectangular white space is shown.
Maybe Google is not showing ads on you pages, because the don't check them.
Surprisingly when I tend like creating a post/topic the ad appears in the header!
User avatar
janus_zonstraal
Registered User
Posts: 6427
Joined: Sat Aug 30, 2014 1:30 pm

Re: Correct Way to Place Google AdSense Code in phpBB 3.2.7

Post by janus_zonstraal »

Sorry! My English is bat ;) !!!
odf
Registered User
Posts: 171
Joined: Sun Jan 22, 2017 8:55 pm

Re: Correct Way to Place Google AdSense Code in phpBB 3.2.7

Post by odf »

Thank you all for contributions. I finally solved the problem and did exactly what I wanted. One ad at the header and another at the footer (with resized heights), only on the index page. I solved the blank/white space problem when viewing topic/forum. The rest of the ads will be served randomly anywhere except on the index page by Google AdSense program auto ads. No ext used.

odf
alvo
Registered User
Posts: 730
Joined: Thu Jun 22, 2006 3:57 am

Re: Correct Way to Place Google AdSense Code in phpBB 3.2.7

Post by alvo »

There is a potential issue with this. AdSense requires that ads only appear on pages with content. The intermediate page you see when you submit a post ("your post was submitted successfully") Google considers as not being content and is in violation with their TOS.
User avatar
WelshPaul
Registered User
Posts: 420
Joined: Tue Aug 19, 2014 2:09 pm

Re: Correct Way to Place Google AdSense Code in phpBB 3.2.7

Post by WelshPaul »

NEVER place your adsense code in overall_header.html and overall_footer.html template files!

Doing so will result in you breaching the Adsense TOS as pointed out already.
odf
Registered User
Posts: 171
Joined: Sun Jan 22, 2017 8:55 pm

Re: Correct Way to Place Google AdSense Code in phpBB 3.2.7

Post by odf »

Surprisingly, Google generated a code, that asked me to put it anywhere between <head> </head>, and they would automatically detect places where their ads fit most. I tried different places, index_body.html, viewforum_body.html and viewtopic_body.html and they placed ads on the homepage in six different places for desktop view and four different places for mobile view! I decided to restricted them to the header and footer.
odf
Registered User
Posts: 171
Joined: Sun Jan 22, 2017 8:55 pm

Re: Correct Way to Place Google AdSense Code in phpBB 3.2.7

Post by odf »

WelshPaul wrote: Wed Oct 16, 2019 9:20 am NEVER place your adsense code in overall_header.html and overall_footer.html template files!

Doing so will result in you breaching the Adsense TOS as pointed out already.
Placed in index_body.html.
Post Reply

Return to “[3.2.x] Support Forum”