Last active
June 19, 2017 18:14
-
-
Save btnwtn/bca69c3c32e4c700b28010a7c22fb2d5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const withTracking = WrappedRoute => { | |
return class PageViewWrapper extends Component { | |
componentDidMount() { | |
console.log(this.props); | |
if (window.dataLayer) { | |
window.dataLayer.push({ | |
event: "pageview or something" | |
}); | |
} | |
} | |
render() { | |
return <WrappedRoute {...this.props} />; | |
} | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment