'matomo'
This commit is contained in:
35
src/app.js
35
src/app.js
@@ -1,21 +1,20 @@
|
|||||||
import { Component } from 'react'
|
import { Component } from "react";
|
||||||
import SDK from 'sr-sdk-h5'
|
import SDK from "sr-sdk-h5";
|
||||||
|
|
||||||
import './app.scss'
|
import "./app.scss";
|
||||||
import 'taro-ui/dist/style/index.scss' // 全局引入一次即可
|
import "taro-ui/dist/style/index.scss"; // 全局引入一次即可
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 有数埋点SDK 默认配置
|
* 有数埋点SDK 默认配置
|
||||||
* 使用方法请参考文档 https://mp.zhls.qq.com/youshu-docs/develop/sdk/Taro.html
|
* 使用方法请参考文档 https://mp.zhls.qq.com/youshu-docs/develop/sdk/Taro.html
|
||||||
* 如对有数SDK埋点接入有任何疑问,请联系微信:sr_data_service
|
* 如对有数SDK埋点接入有任何疑问,请联系微信:sr_data_service
|
||||||
*/
|
*/
|
||||||
|
|
||||||
window.srt = new SDK({
|
|
||||||
|
|
||||||
|
window.srt = new SDK({
|
||||||
/**
|
/**
|
||||||
* 有数 - ka‘接入测试用’ 分配的 app_id,对应的业务
|
* 有数 - ka‘接入测试用’ 分配的 app_id,对应的业务
|
||||||
*/
|
*/
|
||||||
token: 'bi72fccc7184ef45f9',
|
token: "bi72fccc7184ef45f9",
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 传入自定义的后台上报接口,若传入则token将无意义
|
* 传入自定义的后台上报接口,若传入则token将无意义
|
||||||
@@ -51,7 +50,7 @@ import 'taro-ui/dist/style/index.scss' // 全局引入一次即可
|
|||||||
/**
|
/**
|
||||||
* 小程序appid
|
* 小程序appid
|
||||||
*/
|
*/
|
||||||
appid: ''
|
appid: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
// window.srt.setChan({chan_id: 'xxx'}) // 设置渠道,渠道信息将会被设置在props.chan对象中
|
// window.srt.setChan({chan_id: 'xxx'}) // 设置渠道,渠道信息将会被设置在props.chan对象中
|
||||||
@@ -59,16 +58,16 @@ import 'taro-ui/dist/style/index.scss' // 全局引入一次即可
|
|||||||
// window.srt.setUser({user_id: 'xxx'}) // 设置用户信息,用户信息将会被设置在props.wx_user对象中
|
// window.srt.setUser({user_id: 'xxx'}) // 设置用户信息,用户信息将会被设置在props.wx_user对象中
|
||||||
|
|
||||||
class App extends Component {
|
class App extends Component {
|
||||||
componentDidMount () {}
|
componentDidMount() {}
|
||||||
|
|
||||||
componentDidShow () {}
|
componentDidShow() {}
|
||||||
|
|
||||||
componentDidHide () {}
|
componentDidHide() {}
|
||||||
|
|
||||||
// this.props.children 是将要会渲染的页面
|
// this.props.children 是将要会渲染的页面
|
||||||
render () {
|
render() {
|
||||||
return this.props.children
|
return this.props.children;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default App
|
export default App;
|
||||||
|
|||||||
@@ -1,18 +1,43 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
||||||
<meta content="width=device-width,initial-scale=1,user-scalable=no" name="viewport">
|
<meta
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
content="width=device-width,initial-scale=1,user-scalable=no"
|
||||||
<meta name="apple-touch-fullscreen" content="yes">
|
name="viewport"
|
||||||
<meta name="format-detection" content="telephone=no,address=no">
|
/>
|
||||||
<meta name="apple-mobile-web-app-status-bar-style" content="white">
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" >
|
<meta name="apple-touch-fullscreen" content="yes" />
|
||||||
<title>数字游民CNA</title>
|
<meta name="format-detection" content="telephone=no,address=no" />
|
||||||
<link rel="icon" href="./images/nomadcna.ico" type="image/x-icon" />
|
<meta name="apple-mobile-web-app-status-bar-style" content="white" />
|
||||||
<script><%= htmlWebpackPlugin.options.script %></script>
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||||
</head>
|
<title>数字游民CNA</title>
|
||||||
<body>
|
<link rel="icon" href="./images/nomadcna.ico" type="image/x-icon" />
|
||||||
<div id="app"></div>
|
<script>
|
||||||
</body>
|
<%= htmlWebpackPlugin.options.script %>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- Matomo -->
|
||||||
|
<script>
|
||||||
|
var _paq = (window._paq = window._paq || []);
|
||||||
|
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
||||||
|
_paq.push(["trackPageView"]);
|
||||||
|
_paq.push(["enableLinkTracking"]);
|
||||||
|
(function () {
|
||||||
|
var u = "//matomo.digitalnomadchina.com/";
|
||||||
|
_paq.push(["setTrackerUrl", u + "matomo.php"]);
|
||||||
|
_paq.push(["setSiteId", "1"]);
|
||||||
|
var d = document,
|
||||||
|
g = d.createElement("script"),
|
||||||
|
s = d.getElementsByTagName("script")[0];
|
||||||
|
g.async = true;
|
||||||
|
g.src = u + "matomo.js";
|
||||||
|
s.parentNode.insertBefore(g, s);
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
<!-- End Matomo Code -->
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app"></div>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user