react-ga4 icon indicating copy to clipboard operation
react-ga4 copied to clipboard

Documentation update for React GA modalview or add functionality that encapsulate it

Open devchuksemeka opened this issue 2 years ago • 0 comments

React GA has a modalview, and according to documentation, it's basically just an abstraction on pageview here - https://github.com/react-ga/react-ga#reactgamodalviewmodalname. Is it possible to update the documentation for react-ga4 on this?

I had to go digging into the ReactGA.modalview() function here https://github.com/react-ga/react-ga/blob/087837dc03d482549ded7669ac559df0c7cc5498/src/core.js#L237 and it's just creating path = /modal/{passedModalName}.

A document to either let the user know that this should be done if they are migrating a usage of modalview or create a function that abstracte this for the user. I don't mind raising an PR for either that makes sense

Using the abstraction function, adding a new hitType="modalview" maybe

ReactGA4_gaCommandSend() reference https://github.com/codler/react-ga4/blob/d0b14c26a7dd5fdbe98e3dd4ef0e6653d0a19ba3/src/ga4.js#LL324C10-L324C10`

devchuksemeka avatar May 18 '23 23:05 devchuksemeka