Open vijayyadav06 opened 6 years ago
Hi @vijayyadav06 thanks for the question! Sorry for the late response here :)
componentDidMount()
lifecycle method either via using the dispatchOnMount
behavior, or by defining a top-level process
function that can achieve the same result. More details on this in the main README.If you've tried it out and are having any issues with RRv4 would love to hear about them. Feel free to follow-up to this issue or create a new one with some more details.
For example, your dispatch
function could look something like this:
export default function dispatch(data) {
const dataLayer = data.analyticAccount || 'dataLayer';
(window[dataLayer] = window[dataLayer] || []).push(data);
}
And then you can define which analytic account to use wherever appropriate in your tree:
@track({ analyticAccount: 'dataLayer-2' })
class Foo extends Component { ... }
Hope that helps!
Thanks for providing the module. Have two questions -