diff --git a/README.md b/README.md index f0ebf3f..6580cf9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -# React Google Analytics +# React Google Analytics 反应Google Analytics +反应谷歌分析的反应路由器。 如果需要Google Analytics(分析)之类的功能,就可以使用。 [![NPM version][npm-image]][npm-url] @@ -6,21 +7,22 @@ [npm-url]: https://www.npmjs.com/react-g-analytics [github-url]: https://github.com/seeden/react-g-analytics -## Motivation +## motivation 动机 -I needed google analytics working in combination with react-router. +Google analytics works with react router -## Install -```sh +## install 安装 + +``` npm install react-g-analytics ``` -## Features +## features - * Automatically load google analytics scripts (optional - id parameter) - * Automatically send pageview when user will change current route of react-router + * load google analytics scripts (optional - needs an id parameter) + * send pageview when user will change route of script -# Support us +###### support us Star this project on [GitHub][github-url]. @@ -28,12 +30,13 @@ Star this project on [GitHub][github-url]. Use version 0.3.x of the react-g-analytics if you want to use it with react-router 4.x Use version 0.2.x of the react-g-analytics if you want to use it with react-router 2.x or 3.x +It should be good owtherwise -## Usage +## Usage 该代码的用法 ### Example react-router 4.x -User BrowserRouter from react-g-analytics instead of react-router. +User uses BrowserRouter from react-g-analytics instead... ```js import { BrowserRouter } from 'react-g-analytics'; @@ -51,15 +54,19 @@ export default function MyComponent() { ### Example react-router 3.x and bellow -### App.jsx +#### App.jsx -Application part (load google analytics script to your webpage on the client side). -ReactGAnalytics has parameter ID (use your own ID) +Application part (load google analytics script at your webpage on the client side). +this code has parameter ID (use your own ID) ```js var React = require('react'); + + var GoogleAnalytics = require('react-g-analytics'); + + var App = module.exports = React.createClass({ render: function() { return ( @@ -72,7 +79,7 @@ var App = module.exports = React.createClass({ }); ``` -### routes.jsx +### routes.jsx 路线 Define your routes here. @@ -91,7 +98,7 @@ var routes = module.exports = ( ); ``` -### client.js +### client.js 客户 Here is a simple client side @@ -109,7 +116,7 @@ router.run(function(Handler, state) { }); ``` -## Set +## Set 组 If you want to set google analytics parameters after load you can use property named set. Here is small example: @@ -134,12 +141,12 @@ var App = module.exports = React.createClass({ }); ``` -## Skip loading google analytics scripts +## Skip loading google analytics scripts 跳过加载谷歌分析脚本 If you are loading the GA in different way. You can skip autoload of the GA script simply: Do not enter your google analytics ID as parameter. -## Try our other React components +## Try our other React components 尝试其他反应成分 - Translate your great project [react-translate-maker](https://github.com/CherrySoftware/react-translate-maker) - Forms [react-form-controlled](https://github.com/seeden/react-form-controlled) @@ -155,6 +162,6 @@ Star this project on [GitHub][github-url]. ## License -The MIT License (MIT) +the code is licensed at The MIT License (MIT) Copyright (c) 2016 Zlatko Fedor zlatkofedor@cherryprojects.com