Closed sin-to-jin closed 3 months ago
Support for multiple GTMs by allowing state to be specified as an array as well
state
Fix https://github.com/elgorditosalsero/react-gtm-hook/issues/85
const param1 = { id: 'GTM-XXXXXXX', dataLayerName: 'dataLayerFirst', } const param2 = { id: 'GTM-XXXXXXX', dataLayerName: 'dataLayerSecond', }
<GTMProvider states={[param1, param2]}> <p>foo-bar</p> </GTMProvider>
Or,
<GTMProvider states={param1}> <p>foo-bar</p> </GTMProvider>
Summary
Support for multiple GTMs by allowing
state
to be specified as an array as wellFix https://github.com/elgorditosalsero/react-gtm-hook/issues/85
Sample code
Or,