
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
ga-react-router
Advanced tools
This doesn't have any depency on react-router. You can use it with any router you like. See the example for how to use it with react-router
npm install ga-react-router
webpack.config.js
add new webpack.DefinePlugin({GA_TRACKING_CODE: JSON.stringify('XXXXXXXX')})
Router.run
code.import ga from 'ga-react-router'
import createBrowserHistory from 'history/lib/createBrowserHistory'
const history = createBrowserHistory()
// Listen for changes to the current location. The
// listener is called once immediately.
const unlisten = history.listen(location => {
ga('send', location);
});
React.render(<Router history={history}>{routes}</Router>, el)
// When you're finished, stop the listener.
unlisten()
You can pass more information to ga.create()
by adding a GA_CONFIG
object to webpack.DefinePlugin
like so:
new webpack.DefinePlugin({
GA_TRACKING_CODE: JSON.stringify('XXXXXXXX'),
GA_CONFIG: {
'name': 'myTracker'
}
})
You can read further on the subject here.
FAQs
Google analytics component for react-router
The npm package ga-react-router receives a total of 1 weekly downloads. As such, ga-react-router popularity was classified as not popular.
We found that ga-react-router demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.