Skip to content

Customize locale storage key for analitycs #302

@slafayIGN

Description

@slafayIGN

We are building an app with multiple technical components. A React App, a Vue App, an eleventy static site... all living under the same domain name.

If a visitor gives or withdraw its consent for data collection on one of the component and then visit another component, he shouldn't be prompted again for consent.

So we would like to make the localStorageKeyPrefix a param here in order to use a custom name that doesn't contain "@codegouvfr/react-dsfr" : https://github.com/codegouvfr/react-dsfr/blob/main/src/consentManagement/createConsentManagement.ts#L12

export const localStorageKeyPrefix = "@codegouvfr/react-dsfr finalityConsent";

NB : the light or dark color scheme is also a "shared" local storage element, but it's name is simpler. It's just "scheme". So we are fine with it. But it could be customized too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions