Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Support for Google AdSense #315

Open
dSyncro opened this issue Sep 5, 2024 · 6 comments
Open

[Feature]: Support for Google AdSense #315

dSyncro opened this issue Sep 5, 2024 · 6 comments
Assignees
Labels

Comments

@dSyncro
Copy link

dSyncro commented Sep 5, 2024

Feature request

The theme already has support for Google Analytics. I think It would be nice to also have easy integration for Google AdSense on websites in production.

Proposed solution

I think we could easily add a simple partial loading the script in baseof.html pulling required ids and params from the config like already happens with Google Analytics.

Additional context

I also think this feature should be opt-in and disabled by default. Nobody wants to promote ads spamming on websites😜.

Nevertheless I think it might be a useful feature for consumers of the theme and have its close to ethical purposes.

@g1eny0ung
Copy link
Owner

Yes, integrating AdSense looks like easily. But there's one thing I need to consider: where should I put the advertisements?

My first thought was to put it aside on the post page:

image

I don't want to put it on the home page because the masonry layout doesn't have enough space to place it.

What do you think?

@diamantelist
Copy link
Contributor

In the home page, it would be fine to put advertisements just like posts... in posts page, indeed, it would be great to put advertisements on both sides

@g1eny0ung
Copy link
Owner

In the home page, it would be fine to put advertisements just like posts... in posts page, indeed, it would be great to put advertisements on both sides

OK, but I am still concerned about whether it is a good idea to put ads on the home page. And sure, we can also put ads on both sides of the post pages.

@WinPoss
Copy link

WinPoss commented Sep 20, 2024

In the home page, it would be fine to put advertisements just like posts... in posts page, indeed, it would be great to put advertisements on both sides

OK, but I am still concerned about whether it is a good idea to put ads on the home page. And sure, we can also put ads on both sides of the post pages.

I think it's better this way: offer both ways and then let the user choose which one to turn on or off.

@g1eny0ung
Copy link
Owner

In the home page, it would be fine to put advertisements just like posts... in posts page, indeed, it would be great to put advertisements on both sides

OK, but I am still concerned about whether it is a good idea to put ads on the home page. And sure, we can also put ads on both sides of the post pages.

I think it's better this way: offer both ways and then let the user choose which one to turn on or off.

I've already added a slot for AdSense on the post page. To place your AdSense script, you can create an adsense.html under layouts/partials/. It will display under the TOC on the right aside.

For the home page, I've not had permission to open my AdSense, so I still try to find a way to test it.

@g1eny0ung
Copy link
Owner

It will display under the TOC on the right aside.

Now it moves above the TOC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants