Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data collection privacy opt-in/out #470

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

avinder-red-crackle
Copy link
Contributor

TODO

Some of the scripts need to be loaded if user opts in. I was thinking of something like this in _includes/head.html. This requires moving the assets/js/analytics.js script to includes folder and converting segment.html, growthbook.html & clearbit.html to javascript files.

<script>
  var privacyPolicyCookie = getCookie("privacyPolicy");
  if (jekyll.environment == "production" && privacyPolicyCookie == "true") {
    {% include analytics.js %}
    {% include segment.js %}
    {% include growthbook.js %}
    {% include clearbit.js %}
  }
</script>

Any thoughts?

@thtmnisamnstr
Copy link
Contributor

That approach makes sense. I added the Intercom snippet back to the head.html file. We were loading it via Segment, but, it should always load if in production no matter whether they opted in or out (whether Segment loads or not). So don't include it with the snippets you put behind this logic check.

This is the process I'm looking for with this. I think what you proposed works with these requirements:

  • If a user clicks yes to the privacy opt-in, we should set the privacy cookie and reload the page. The privacy cookie should persist between pages and sessions, and, if set, we should just load our analytics and a/b testing snippets without displaying the privacy opt-in box.
  • If a user clicks no to the privacy opt-in, we should clear all of our cookies (including the privacy cookie) and not reload the page. Since no cookie is set, we shouldn't loud our analytics and testing a/b snippets, and we should always display the privacy opt-in box.

@thtmnisamnstr
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants