Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: rhnegativeforum on January 27, 2019, 06:42:13 PM

Title: Google Automated Ads and SMF Forums
Post by: rhnegativeforum on January 27, 2019, 06:42:13 PM
Hi everyone!
I am running SMF on www.rhesusnegative.net/rhnegativeforum
Since I have activated Google Adsense Automated Adsense, I am wondering which is the simplest way and where to install my code to have it show up all over the forums.

P.S.: The content of the forum is hidden and visible to members only. Will that make a difference?
Title: Re: Google Automated Ads and SMF Forums
Post by: vbgamer45 on January 27, 2019, 07:29:52 PM
I like to do placements not auto ads since they don't appear everywhere.

Then use a mod like ad management mod to do the placements
Title: Re: Google Automated Ads and SMF Forums
Post by: drewactual on January 27, 2019, 08:45:13 PM
just a warning:

Adsense will not like being on pages without a certain amount of content and will put you in the penalty box for doing so.  They also don't like being put in places inaccessible by the public, and will put you in the penalty box for that too. 

Title: Re: Google Automated Ads and SMF Forums
Post by: Aleksi "Lex" Kilpinen on January 27, 2019, 11:41:16 PM
Actually, unless I am mistaken, adding adsense to a members only site is in violation of the AdSense rules directly, because in AdSense's point of view all ads will be on landing pages - and that is forbidden. This is at least how I have interpreted the rules for years now.
Title: Re: Google Automated Ads and SMF Forums
Post by: drewactual on January 28, 2019, 12:06:52 AM
It is in violation.
If his/her site was more than just a forum, ie with a lot of content and the forum blended in, he might not be in violation so long as the ads didnt show up on members only pages.  But, after looking at his site there isnt any way to pull it off and stay within the rules.
Title: Re: Google Automated Ads and SMF Forums
Post by: rhnegativeforum on January 30, 2019, 07:20:48 AM
Thank you to all of you for your replies. I was under the impression that with Automated Ads, I just add a code and Google decides where to place ads. No penalty risk. My question would be where to add that Google code to cover the entire forum. Within a month or two, I am going to make the main part of the forum public. So what I want to do is simply add the code so ads will start appearing where Google thinks they should be placed.
Title: Re: Google Automated Ads and SMF Forums
Post by: Mick. on January 30, 2019, 07:28:49 AM
If your forum is private as a guest, google can't access either to read your website so it can show relevant ads. Not sure if that's a violation but i've been fooled before.


Anyways, copy and paste the autoads code after the <head> tag in index.template.php file of your current theme.

For example:

<head>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({
          google_ad_client: "ca-pub-****************",
          enable_page_level_ads: true
     });
</script>
Title: Re: Google Automated Ads and SMF Forums
Post by: drewactual on January 30, 2019, 07:47:55 AM
Quote from: rhnegativeforum on January 30, 2019, 07:20:48 AM
Thank you to all of you for your replies. I was under the impression that with Automated Ads, I just add a code and Google decides where to place ads. No penalty risk. My question would be where to add that Google code to cover the entire forum. Within a month or two, I am going to make the main part of the forum public. So what I want to do is simply add the code so ads will start appearing where Google thinks they should be placed.

if you want to put it there temporarily just to see how it looks/flows with the page you should be okay.. but if you put it in the forum and it isn't accessible by the public for any amount of time you may get kicked out of the program before you even get started (couple months). 
Title: Re: Google Automated Ads and SMF Forums
Post by: rhnegativeforum on February 03, 2019, 09:40:10 AM
I still don't understand why Google would add automated ads on a page they cannot read. I don't think they do that. I did however hear that there is a way to give Google a login/access to membership only pages.

I have decided that out of the two major sections on my forum, I will make one public, keep the other private. Is there a short tutorial somewhere to save me time figuring out how?
Title: Re: Google Automated Ads and SMF Forums
Post by: rhnegativeforum on February 03, 2019, 11:05:45 AM
Quote from: Mick. on January 30, 2019, 07:28:49 AM
If your forum is private as a guest, google can't access either to read your website so it can show relevant ads. Not sure if that's a violation but i've been fooled before.


Anyways, copy and paste the autoads code after the <head> tag in index.template.php file of your current theme.

For example:

<head>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({
          google_ad_client: "ca-pub-****************",
          enable_page_level_ads: true
     });
</script>
Thank you, Mick.