New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
无法使用百度统计或者腾讯统计 #7
Comments
最后我把统计的代码放在 /vues/demo/index.vue这种位置居然成功了,作者大大能改进一下么,放在这里不太优雅 |
app\wechat\views_common\hook\baidu.html 里的代码检查一下,是不是没包<script>,示例文件里是这样的:
|
包了的 |
<script type="text/javascript"> var _mtac = {"autoReport":0}; (function() { var mta = document.createElement("script"); mta.src = "http://pingjs.qq.com/xx.js?v2.0.4"; mta.setAttribute("xx", "xx"); mta.setAttribute("xx", "xx"); var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(mta, s); })(); </script> |
看一下页面响应里(控制台 -> Network -> Doc - Response),有没有这段? |
有这段的。js也是可以请求到的 |
不过我不是最新的 |
代码里面我也没看到你引用过baidu.html这个文件呀 |
模板里引用顺序是:
为了方便管理多种第三方脚本的,你跑一下模板看看能不能发出去? |
你说的这些我都试过了,无论这段js放在view下的哪个html都不行,但是放在vues下面的模块的index.vue就可以。我已经测试很多遍了 |
app\wechat\views_common\layout.html 中的 views_common 是你自己建的么?
|
这里不能截图,我的目录是views\ _common\baidu.html,而layout是views\layout.html |
layout.html引用的baidu.com在谷歌浏览器中可以看到代码运行了呢 |
那就是加载统计脚本的代码运行了,然后腾讯的JS也加载进来了,但是在后台看不到数据对吧。。。 参考最新版的MTA文档
|
貌似还是不行呢。无论后面我能不能成功进来,都很感觉你哦,真是一个very nice的人呢,么么哒 |
在app\wechat\views_common\hook\baidu.html中添加统计的js, 在app\wechat\views_common\layout.html中引入。代码如下: {% include "hook/baidu.html" %}
可以无论如何都无法在统计后台看到数据,作者大大能帮忙看一下么
The text was updated successfully, but these errors were encountered: