react-ga組件的簡單應用筆記

npm install react-ga --save  //導入react-ga組件 找到要檢測的頁面組件,在組件中添加語句如下: ReactGA.initialize的參數 是google 網頁生成的(analytics.google.com) componentDidMount 內保證刷新頁面或者第一次加載時 走ga componentWillReceiveProps 內保證切換route時
相關文章
相關標籤/搜索