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

Update cookie banner guides - include notes to disable additional features #10004

Open
4 of 16 tasks
MarconLP opened this issue Nov 28, 2024 · 0 comments
Open
4 of 16 tasks
Assignees

Comments

@MarconLP
Copy link
Member

MarconLP commented Nov 28, 2024

Summary

Our current cookie banner guides will only disable cookie persistence when rejected. We should include a note letting users know that they can disable additional features:

  • disabling event capture entirely (posthog.opt_out_capturing())
  • disabling surveys
  • disabling autocapture
  • disabling replays
export const configForConsent = (): Partial<PostHogConfig> => {
    const consentGiven = localStorage.getItem('cookie_consent') === 'true'

    return {
        persistence: consentGiven ? 'localStorage+cookie' : 'memory',
        disable_surveys: !consentGiven,
        autocapture: consentGiven,
        disable_session_recording: !consentGiven,
    }
}

export const updatePostHogConsent = (consentGiven: boolean) => {
    if (consentGiven) {
        localStorage.setItem('cookie_consent', 'true')
        posthog.opt_in_capturing()
    } else {
        localStorage.removeItem('cookie_consent')
        posthog.opt_out_capturing()
    }

    posthog.set_config(configForConsent())
}

What kind of request is this?

  • New docs page / feature
  • Update to existing page

Which product is this for?

  • Product OS (e.g. platform features)
  • Product analytics
  • Session replay
  • Feature flags
  • Experiments
  • Surveys
  • CDP
  • Data warehouse
  • Other (e.g. open source specific)

What's the priority?

  • Urgent AND important ("great scott, this is horribly wrong / out of date")
  • Important, but not urgent ("we need to do this, but not immediately")
  • Non-urgent (this could be better / would be nice to have)

Is there a deadline for this change?

  • Yes (please specify)
  • No
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

No branches or pull requests

2 participants