0

I have a website running using an external JS-File from a service running for cookie consent.

<script id="Cookiebot" src="https://consent.cookiebot.com/uc.js" data-cbid="abc" data-blockingmode="auto" type="text/javascript"></script> 

I have no access to that hosting server.

This scripts builds some code on the page like:

Some Content

Now I want to hide these divs or prevent the script from running on certain client IP-addresses, as we take screenshots of the page for search and some heatmaps etc. which should not show the cookie consent. I know the IP-ranges of these services.

I think the easiest way is to do something like adding alter the style or add a css-class with display: none !important to the element

like doing some js: if ip of client is == 123., 123.234. then do somethting to id "abc" and "efg"

Can anybody help or has a more elegant idea?

I think i t would be even better to do it with PHP:

Idea if ip is not 123., 321. then output

endif

Sorry for asking as I am quite into design, HTML, and CSS, but am a JS, PHP newbie...

Pelle
  • 21
  • 4

0 Answers0