News:

Wondering if this will always be free?  See why free is better.

Main Menu

Script in News section

Started by dekatria, March 30, 2017, 10:59:07 PM

Previous topic - Next topic

dekatria

Hi,

I currently use the "News" area of my forum as an advertising area, displaying banners. In order to add the html code of the banners, I use the HTML tag. It works fine.

Now I want to display adsense ads in this area. Their code is based on a script. Although I enclose the code in HTML, still the new ads do not display.

the code is:
Quote<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- ForumTop -->
<ins class="adsbygoogle"
     style="display:inline-block;width:728px;height:90px"
     data-ad-client="ca-pub-XXX4019008XXXXX"
     data-ad-slot="715346XXXX"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

Bob Perry of Web Presence Consulting

#1
Most likely getting truncated, check your error log... not recommended to use the news area for that seo wise, better off inserting it into the index template.

Also if this was done very recently and its the first advertising you've done with adsense from this domain, it takes adsense a little while to start feeding your ads... but that field will support only very simple types of html tags and is usually short text oriented...

Better than inserting that code into the index template there is also a free module available that is designed specifically for advertising and I myself also use it for displaying other types html as well... That would be your best choice because if you use the template EVERYONE gets forced to see the ads but with the module you have a myriad of control over who, what , and where the ads get displayed, some users will complain and others will ignore and do their thing, depends, also with the module its easier to tweak when you must make adjustments to those controls to comply with good practice or user demands...

Here's a link to the mod... http://custom.simplemachines.org/mods/index.php?mod=255

There is a reason its the second most downloaded module available here, its quite effective for your purpose...

;)
Best Regards,
Bob Perry



"The world is moving so fast these days that the man who says it can't be done is generally interrupted by someone doing it." Elbert Hubbard

dekatria

Thank you very much for your reply.
I followed your suggestion to install the ad management mod.
Unfortunately the installation test failed in my current theme's index template.

Specifically:
http://prnt.sc/eqvxah


Bob Perry of Web Presence Consulting

#3
Quote from: dekatria on March 31, 2017, 03:29:30 PM
Thank you very much for your reply.
I followed your suggestion to install the ad management mod.
Unfortunately the installation test failed in my current theme's index template.

Specifically:
http://prnt.sc/eqvxah



Yes that happens sometimes, but it would be well worth your efforts to edit the theme file manually if its only one failed test, if you are familiar with manual edits its easy to correct... if not, I may be able to edit the file myself if you will post a snapshot of the error msg and attach a copy of your index.template.php from that theme here... if you do that go ahead and ignore the error msg and install, upload the template and screenshot after you're done, I will fix the file and attach it back to you, then you just upload the file back to its original directory and should be fine... even if you don't do a manual edit, most the module should work fine anyway, it depends on the actual error and where it is at in the template...

Oops, i see that you did post a snapshot of the error, you can completely ignore that error if you wish, you just won't be able to place ads in the user welcome area is all that is telling you... everything else should function normally.

OR, you can go ahead and install, then upload the template here, that's an easy one to fix...

If you have a lot of traffic, this module can be quite lucrative with generating revenue for you if used properly, and the users don't even have to do anything except what they feel like doing, you get paid even if they don't click anything and ignore the ads...
Best Regards,
Bob Perry



"The world is moving so fast these days that the man who says it can't be done is generally interrupted by someone doing it." Elbert Hubbard

Steve

DO NOT pm me for support!

dekatria

Thank you very much!
I will post again or message you if there is any problem.

Advertisement: