we're in process of building a public website(No login) based on Lightning community We're planning to use google analytics(GA) in our website and also try to be GDPR/PECR compliant. As per regulation, it seems we need to provide cookie banner and have to give option to external user to give his/her consent before storing GA Cookies.

But what we know, GA traking id is set in community level(builder) and once it is set, Salesoforce provide no way to stop Google for storing its cookies.

Question is - how can I stop storage of GA cookies, if suppose in community user doesn't give his/her consent?

In our analysis we find, Google provides option for opt-out: https://developers.google.com/analytics/devguides/collection/analyticsjs/user-opt-out

But this works on 'Window' object. As far as I know actual window object is not exposed because of locker service so we can't modify its properties.

Is there any way out ? One option I think- we've to? delete GA cookies on load of every page, if user has not given his/her consent but is that correct approach?

  • Does no one has any solution or even suggestions for this ? – sfdc_Qrius Apr 25 at 15:15
  • I'm in a similar scenario to you as well - I've not tried it, but I think deleting the Google Analytics cookies would still involve the user's information being collected and sent to Google - It just might appear as different users or sessions. – Sam Bunting Apr 28 at 9:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.