GA 更新

This commit is contained in:
ciaochaos 2020-07-02 13:40:33 +08:00
parent 728eb900c3
commit e5aae8511c
2 changed files with 15 additions and 10 deletions

View File

@ -2,16 +2,7 @@
<html lang="zh"> <html lang="zh">
<head> <head>
<!-- Global site tag (gtag.js) - Google Analytics --> <!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-165845289-1"></script>
<script data-ad-client="ca-pub-3611009408282658" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <script data-ad-client="ca-pub-3611009408282658" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-165845289-1');
gtag('config', 'G-3NKS6ZG27V');
</script>
<script> <script>
(function(){ (function(){
var bp = document.createElement('script'); var bp = document.createElement('script');

View File

@ -13,7 +13,21 @@ import {loadDownloadData} from "../../actions";
import ReactGA from 'react-ga'; import ReactGA from 'react-ga';
import {setScrollbarWidthProp} from "../../utils/util" import {setScrollbarWidthProp} from "../../utils/util"
ReactGA.initialize('UA-165845289-1'); ReactGA.initialize(
[
{
trackingId: 'UA-165845289-1',
gaOptions: {
name: 'trackerUA',
}
},
{
trackingId: 'G-3NKS6ZG27V',
gaOptions: { name: 'trackerG' }
}
],
{ debug: true, alwaysSendToDefaultTracker: false }
);
function App({ dispatch }) { function App({ dispatch }) {
const updateDownloadData = useCallback((downloadData) => dispatch(loadDownloadData(downloadData)), []); const updateDownloadData = useCallback((downloadData) => dispatch(loadDownloadData(downloadData)), []);
setScrollbarWidthProp() setScrollbarWidthProp()