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

[seo-magic] WebShot screenshot shows cookie banner. How to get rid of it? #402

Open
marcocevoli opened this issue Dec 8, 2023 · 3 comments
Assignees
Labels
seo-magic SEO Magic plugin

Comments

@marcocevoli
Copy link

Hi,

Page screenshots generated by WebShot include our (ugly :) ) cookie banner. Is there any trick to get rid of it from the screenshots?

See https://i.imgur.com/Ejf2tSa.png (taken from a LinkedIn message)

TIA,
Marco

@marcocevoli marcocevoli added the seo-magic SEO Magic plugin label Dec 8, 2023
@rhukster
Copy link
Member

As the webshot functionality is really just firing up a browser and taking a screenshot, it's going to show whatever your site shows to a new user. The best option would be to disable the cookie banner for the webshot useragent. I'm not 100% sure what this is off the top of my head, but inspecting your webserver logs would show the useragent used for webshotting, and that is what you could use to determine if you should hide the banner.

Not a great answer I know, but it's the best I can come up with righ tnow 🤷🏻

@marcocevoli
Copy link
Author

If I'm not mistaken, the user agent can be now set in the Admin panel of SEO Magic. By default it's "Grav SEOMagic Plugin".
I tried to hide the banner through a JavaScript, but I must be doing something wrong, because it isn't working.

I don't know if I'm the only one having this issue, but if others found a way to solve it, I'll be glad to hear from them. :)

@marcocevoli
Copy link
Author

Sorry to revive this old issue, but I haven't found a reliable way to tackle it.

Would it be too much to ask to add an option in the YAML file, such as webshot_css: .cookie-banner {display: none !important} and then adding a line in the SEOMagic.php, so that the css is injected in the request?
I've tried the user agent approach with no luck. BTW, we're using Iubenda for the cookie banner, if this might help.
TIA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
seo-magic SEO Magic plugin
Projects
None yet
Development

No branches or pull requests

2 participants