Jump to content

Add Blocks Containing Google Adsense Code to Articles


Robert222

Recommended Posts

At this moment in time, google adsense can be added to the side bar and in various different other areas. However, for me, a major problem is not being able to add google adsense ads to posted article content (it can be kind of done manually but is a pain in the a**!). It can also be done by adding a single line of code from google and adding this code to the global template of your IPS website. This however places google ads everywhere on your site! So you then need to go on to your google adsense account and spend time adjusting your ads choosing where you wish to show ads on your site and which parts of your site you do not wish to show ads. This is definitely time consuming and could prove problematic given how complicated an IPS website is made up. However this latter part could be done I think.

BUT... Admins could have so much MORE control over the placement of google ads if custom 'Blocks' were able to be added within the content of articles. Admins could manually add block code within articles i.e. add {block="my_google_adsense_code"} in between article content (photos and text) or have the ability to automatically place 'Block's throughout an article because no one wants to manually add anything or edit a thousand articles to add 'blocks', too time consuming so the "Automatic" option would be the way to go. And so this would simply be an extra setting when creating and submitting a New Article. Within the settings, it would be a good idea to allow Admins the choice of selecting how many block ads to display throughout an article? This would obviously need to be created under google adsense guidelines. The ads should automatically spread out throughout an article and adapt to different length articles, so as not to annoy user readability.

If members of wesbites are allowed to add articles then the 'Google Adsense' Block feature should be automatically added so Admins can benefit from 'Guest Article submissions'.

Enabling this powerful feature would also allow Admins to fully offer and promote "Ad Free" viewing by offering members to pay a monthly subscription to view the website totally "Ad Free". You can do that just now with the standard created block ads within the side bar etc but if Admins wish to capitalise on making as much money as possible and are able to add 'Blocks' to Articles, then the whole website could be "Ad Free" viewing for payed members.

I'm actually surprised IPS designers don't think about these features when creating blocks for google advertising and general advert creation / promotion? If you are designing a website to enable 'Blocks' to be added to pages and side bars etc, why not allow the 'Blocks' to be added to articles as well??

 

I really hope this can be included in the next update!

Link to comment
Share on other sites

3 minutes ago, Morrigan said:

Maybe I’m just daft or I’m not understanding what you’re looking for but can’t you do this with a custom editor button that is restricted for just admins to use?

I don't know what that is.

6 minutes ago, Morrigan said:

Maybe I’m just daft or I’m not understanding what you’re looking for but can’t you do this with a custom editor button that is restricted for just admins to use?

Custom buttons cant be dynamic or use javascript so I guess now.

Link to comment
Share on other sites

Well if its a single line of Google code it would. It would do the "manual" work for you with the click of the button. You may want to use the "Option" if you need a special code per one or a special tag or whatever but it would insert the HTML on button click and by setting the permissions you can make it to where only those groups that you want the ability to be able to do this access to do it while keeping it out of the hands of your normal end users.

I think it would do what you want since all you want is to be able to auto insert some code. My solution would do that for you.

Link to comment
Share on other sites

Also if its a button then the problem is even if it did work, Admins would still need to add the block manually to articles. And after posting, the actual block would not be able to be hidden so not great to be honest and not user friendly in a way that I was originally asking for.

Link to comment
Share on other sites

I don't think I understand then. If you're inserting a block of code.... you use the button.

So if I wanted to insert:

<script src='https://mygoogleadsense.script/magically.add.this.thing'></script>

It will do it. All you have to do is put the code that you would currently have in your block into the HTML portion of the button which is essentially what the block is doing anyways, isn't it?

Link to comment
Share on other sites

Lets say that worked. And the google ad was posted within the content of an article. 

Now lets say I've posted over a thousand articles on my site, all containing google ads thanks to the new button.

How do I hide all those ads without having to manually edit each individual article?

Link to comment
Share on other sites

You wouldn't be able to without an SQL query. You also really wouldn't be "hiding" them with the block route though. If you deleted the block so it had nothing to reference you'd be changing an advertisement for {block='my_ad_block'} references. But I'm not sure that's how IPS would implement something like this anyways. Most likely they would convert the "block" code to the HTML that was in the block and save it (similarly to how BBCode, which is now deprecated) is/was handled so you'd be in the same predicament in either scenario.

Link to comment
Share on other sites

Add your Google adsense code to a widget then embed the widget on the page(s) you want it displayed (you wouldn't do every article, just one article and it will display on every article page inherently). You can then delete the block or adjust permissions for the block later if needed.

Link to comment
Share on other sites

On 1/11/2021 at 3:53 PM, bfarber said:

Add your Google adsense code to a widget then embed the widget on the page(s) you want it displayed (you wouldn't do every article, just one article and it will display on every article page inherently). You can then delete the block or adjust permissions for the block later if needed.

Questions:

How do you add google adsense code to a Widget? Where are the widgets within IPS? Which part of the template would you embed the widget into in order to affect all articles?

Link to comment
Share on other sites

On 1/11/2021 at 8:53 AM, bfarber said:

Add your Google adsense code to a widget then embed the widget on the page(s) you want it displayed (you wouldn't do every article, just one article and it will display on every article page inherently). You can then delete the block or adjust permissions for the block later if needed.

The problem Brandon, is what they want to do is implement Adsense code periodically in their articles so something like:
 

Quote

 

Paragraph of text

Advertisement

3 paragraphs of text

Advertisement

 

Their preferred solution is already using a widget (aka Pages block) to perform this task by being able to utilize them in an editor by just adding {block='myadvert'} which is not possible and with the deprecation of BBCode I doubt will be possible.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Upcoming Events

    No upcoming events found
×
×
  • Create New...