greenmeteor / adsense Goto Github PK
View Code? Open in Web Editor NEWThis module adds a simple Google Adsense widget.
Home Page: https://marketplace.humhub.com/module/adsense/description
License: GNU Affero General Public License v3.0
This module adds a simple Google Adsense widget.
Home Page: https://marketplace.humhub.com/module/adsense/description
License: GNU Affero General Public License v3.0
Hello,
it's me again:
Google was not validating my humhub site: https://support.google.com/adsense/answer/10502938?hl=de&visit_id=637691096271317556-3796207143&rd=2
I guess one reason could be the mod is showing ads to guest users even if he visits account-protected contents (which results in no dublicate or "bad" content from the point of google).
I suggest following modification (maybe you can add a more configurable option "Show ads to guests on login-pages...?" or similar!?
\humhub\modules\adsense\Event
public static function addAdFrame($event)
{
if(\Yii::$app->user->isGuest && \humhub\modules\user\helpers\AuthHelper::isGuestAccessEnabled()){
$event->sender->addWidget(widgets\AdFrame::class, [], ['sortOrder' => Yii::$app->getModule('adsense')->settings->get('sort')]);
}
}`
regards,
Till
Off-Topic feature request: Only show ads if user confirms to cookie-consent-banner?
The first step to use Google AdSense is to get the HumHub site verified by placing a string similar to "<script data-ad-client="ca-pub-xxxxxxxxxxxxxxxx" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>" into the <head> of the site.
I have installed the HumHub Google AdSense module and signed up for an AdSense account. The information input into the AdSense module requires a "slot" input which is not made available in the first instance by Google AdSense, I have since retrieved this value but would still like to place the code into the <head> of the site. To circumvent this, I have attempted to use Custom HTML and place the String into the <head> of the site by using the "protected/humhub/views/layouts/head.php" as outlined in Issue #2663 and Issue #4802. After placing this string and waiting for all CRON and SQL jobs to run, clearing the cache and trying on multiple devices the string still does not exist in the <head> of the site.
After placing the string in the "protected/humhub/views/layouts/head.php" file, I would expect to see "<script data-ad-client="ca-pub-xxxxxxxxxxxxxxxx" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>" placed in the <head> of the website as per Google AdSense Guidelines.
The code was not present in the of the site.
Q | A |
---|---|
HumHub version | 1.7.2 |
PHP version | 7.3.23 |
Operating system | Linux |
Helllo,
I am new to humhub and this module, please excuse if my question was answered before already anywhere?
As I know, it is nessecary to serve an ads,txt file to get the revenue for google.
I think I have to add this for myself, or does the module provide the ads.txt anyway?
Thank you!
Hello.
To meet Google Adsenses policy, I need to be able to remove the ads on pages that are without content or with low value content, that are used for alerts, navigation or other behavioral purposes. I believe I'm being flagged for the directory page which has an ad slot, but no content to satisfy Google's policy..
Is there any easy way to edit that particular page to remove the ad block?
Thanks in aadvance.
Tim.
It would be good to make it configurable to show or not show the widget on some display aspects.
Install AdSense module from Browse online area
AdSense works without a problem
Refused to load the script 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js' because it violates the following Content Security Policy directive: "script-src 'self' 'nonce-_someverylongstring_' 'unsafe-inline' 'unsafe-eval' 'report-sample'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.
Q | A |
---|---|
HumHub version | 1.5.1 |
PHP version | 7.4 |
Operating system | CentOS 8 |
There's no error from HumHub, this error is seen using Chrome developer console (ctrl-shft-J).
Because of the CSP, google ads don't show up on the site.
I've spend 3 hours on this already reading up on CSP items and changing my rules in:
/home/somepath/protected/config/web,php
but to no avail.
I have to full CSP defined here:
https://docs.humhub.org/docs/admin/security/#web-security-configuration
With my script-src section showing:
"script-src" => [
"self" => true,
"https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",
"unsafe-inline" => true,
"unsafe-eval" => true,
"report-sample" => true
],
I did also try an:
"script-src" => [
"self" => true,
"allow" => [
"https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",
],
"unsafe-inline" => true,
"unsafe-eval" => false,
"report-sample" => true
],
but both do the same thing.
Please assist it's tricky!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.