Prevent user-agent Googlebot from seeing my cookie consent
Hi folks, I need to find a way to exclude Googlebot (only) from seeing the cookie consent since cookie consent is loading from a third party javascript (OneTrust); is cloudflare of any help to be able to do that ?
1 Reply
So you're using a third party js snippet, not zaraz or anything? You'd need a solution on their end or your own custom js. In theory you could use a Worker or a snippet to dynamically inject the js snippet only if not the right user agent/verified bot, but way overkill.
What's your reasoning anyway? Looks like if it's just the cookie banner and you're worried about deindexing or something that it's not a valid concern: https://www.reddit.com/r/bigseo/comments/11gc4z5/want_privacy_compliance_but_dont_want_our_site/ and that Google may even not like that you're not serving the same content as users see, but not my area