Forum Moderators: open

Message Too Old, No Replies

GDPR cookie notice interfering with new images loading

can only load one or the other

         

Lorel

8:41 pm on Oct 19, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



We moved the GDPR cookie notice from the side of the browser to the very top and now new images we've loaded weren't loading. I removed the GDPR temporarily and the images loaded, then I put it back and now the cookie notice won't load.

Anyone else having a similar problem or know what could be causing this?

BTW the cookie notice is within a Google analytics include (below the GA code) just in case that is an issue.

keyplyr

8:52 pm on Oct 19, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



...the GDPR cookie notice...
Are you using a script someone else wrote? If so, you'll always be dealing with the limitations of how that script is written. JS is not that complicated. Read a few tutorials and try writing your own code, then you can make it work anyway you like.

However, (it is promised) soon Chrome will have its own notice. The other major browsers should follow, so you may not need to host a cookie notice script at all.

keyplyr

8:09 am on Oct 20, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Another idea is to load the script async (independently.)

You can leave it in that include, but just add "async" to the script tag like this:

<script src="cookie_notice.js" async></script>

justpassing

10:01 am on Oct 20, 2018 (gmt 0)

5+ Year Member Top Contributors Of The Month



now new images we've loaded weren't loading.

I do not understand this sentence.

Lorel

6:34 pm on Oct 20, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



thanks for the replies. I figured out that the reason the images weren't loading was because when changing some images from gif to png I had copied the url and included a curly quote so then images didn't load. I should have validated the code before posting a message. My apologies for that mistake.

However after fixing that and using CrazyEgg to analyze the pages I noticed out of 22 visitors very few clicked the cookie script off. Most people are ignoring it unless it's in the way of a link they want to click on.

@Keyplr would adding "async" to the script cause it to load after the page content loads? It is already taking about 3 seconds to load for most visitors - which means some people aren't seeing it if they scroll down the page right away.

keyplyr

7:33 pm on Oct 20, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Using async loads the script independently of other objects and *should* allow the script to display a little faster.

***

All site owners must find that "sweet spot" for things like this.

If you are putting the notice in a fixed position at the top allowing scrolling to avoid displaying it, that is probably not the best place to put it.

Opinions will vary, but I think this notice is the type of thing you *do* want to be intrusive. It *should* interfere with reading the page... otherwise visitors will just scroll away from it and it will not have the intended effect.

So I would float the notice so it's always displayed until the visitor accepts.

lucy24

11:42 pm on Oct 20, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



so it's always displayed until the visitor accepts
Or declines, if you’re making any pretense at genuine GDPR compliance.

justpassing

10:56 am on Oct 21, 2018 (gmt 0)

5+ Year Member Top Contributors Of The Month



It is already taking about 3 seconds

Host the script yourself, or embed the javascript into your page. Like that no delay.

keyplyr

11:14 am on Oct 21, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Host the script yourself
That goes without saying. Never use anything (including scripts) on your pages that are hosted remotely. That's an extra HTTP connection that you are demoted by Google Page Speed. That goes against ranking. Plus, that 3rd party now has control over your pages.

justpassing

11:22 am on Oct 21, 2018 (gmt 0)

5+ Year Member Top Contributors Of The Month



Plus, that 3rd party now has control over your pages.

Indeed. As well as hackers... imagine when such third parties get compromised, hackers could server malicious codes to billions of people ... This is why a publisher needs to be careful of what he uses, and also the security headers he set for his pages ...

Lorel

6:02 pm on Oct 21, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I had it movedto top of browser screen because when viewing several visitors in CrazyEgg , when it was loading at the bottom of the browser window, it was covering up vital parts of the page (parts request form, menu, link to home page, etc, especially in mobile). I hadn't thought about having it scroll down the page however.

Thanks for the tips everyone.