Hi, with the GDPR compliance deadline around the corner many sites/developers are taking measures to get through with it. The eu_cookie_compliance module has taken a big step blocking any configured JS scripts from being loaded (GA, GTM, Sharethis) until the user gives explicit consent to allow cookies. All that fails when comes to hotjar as the module injects the script initialization right into the html head. That could be avoided using a generated script just like google_tag module does. I'll happy provide a patch (already working on it) in an hour or 2.
Using the access API can be used to achieve this but it doesn't feels the right solution as implies eu_cookie_compliance and any other GDPR-pro module to be aware of hotjar hooks.
Comment | File | Size | Author |
---|---|---|---|
#5 | interdiff-4-5.txt | 1.2 KB | d70rr3s |
#5 | 2974719-do_not_load_hotjar_script_until_cookies_are_consent_by_user-5.patch | 5.59 KB | d70rr3s |
#4 | 2974719-do_not_load_hotjar_script_until_cookies_are_consent_by_user-4.patch | 5.61 KB | rosinegrean |
#4 | interdiff-3-4.txt | 1018 bytes | rosinegrean |
Comments
Comment #2
d70rr3s CreditAttribution: d70rr3s at Hiberus commentedUploading patch as promised. Steps to test:
Now if you open a private browsing window you can see that Hotjar script is only included after you accept the cookies policy. In case of withdraw of consent there's an ongoing development in eu_cookie_compliance module to drop any cookies inserted by disabled javascripts.
Comment #3
d70rr3s CreditAttribution: d70rr3s at Hiberus commentedComment #4
rosinegrean CreditAttribution: rosinegrean at PitechPlus commentedHello,
I'm using this patch but keep getting this error:
"An error occurred saving one or more snippet files. Please try again or contact the site administrator if it persists."
But i'm getting this when the file is created and saved.
I'm attaching a patch and the interdiff.
Comment #5
d70rr3s CreditAttribution: d70rr3s as a volunteer commentedHi @prics you're right the proble is the condition. Refactored to properly assert the file save logic.
Comment #7
tikaszvince CreditAttribution: tikaszvince at Integral Vision Ltd commentedHi @prics and @d70rr3s
Thank you for your contribution. New release contains your work.
Comment #9
sic CreditAttribution: sic commentedWe also need this for d7 please :)
Comment #10
Samuel123456789 CreditAttribution: Samuel123456789 commentedHey I want to use it with the iubenda cookie solution but it doesnt work