Giter Site home page Giter Site logo

greenmeteor / adsense Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 4.0 81 KB

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

PHP 100.00%
adsense google-adsense humhub widget google-adsense-widget humhub-module hacktoberfest

adsense's People

Contributors

archblood avatar felli avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

adsense's Issues

ads.txt

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!

Getting Google ads to show with the AdSense module

What steps will reproduce the problem?

Install AdSense module from Browse online area

What is the expected result?

AdSense works without a problem

What do you get instead?

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.

Additional info

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!

Google terms/Only show up if guest(access)

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?

1.2.x Roadmap

Currently working on the section as followed for implementation.

More to add when needed or suggested by followers.

head.php not rendering code

What steps will reproduce the problem?

Using Google AdSense.

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.

What is the expected result?

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.

What do you get instead?

The code was not present in the of the site.

Additional info

Q A
HumHub version 1.7.2
PHP version 7.3.23
Operating system Linux

Configurable Display

It would be good to make it configurable to show or not show the widget on some display aspects.

Remove adsense from Humhub directory page

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.