Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

react-ga integration with react-cookie-consent #535

@matchmakers69

Description

@matchmakers69

I am using package react-cookie-consent to display cookies footer with buttons "Accept cookies" or "Decline" what I want is to initialize cookies ReactGA.initialize("unique tracking") on button click not directly in App.tsx. When I added that functionality kind of works but on refresh I am getting warning all the time: [react-ga] ReactGA.initialize must be called first or GoogleAnalytics should be loaded manually. I don't want to initialize cookies straight away, only when user clicks Accept cookies button. Is there a way to remove warning?

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