55 lines
2.4 KiB
JavaScript
Raw Normal View History

2024-12-26 14:18:10 +08:00
//前方统计-手机端
var _maq = _maq || [];
function loadQFStat(){
var rqStr = window.location.href.match(/(\d{4}-\d{2})\/(\d{2})/i);
var _paper_date = rqStr[1]+"-"+rqStr[2];
_maq.push(['_paper_date', _paper_date ]);//报纸日期
_maq.push(['_set_account', '数字报']);
_maq.push(['_page_url_type', window.location.href.indexOf("node")>=0?0:1]);//访问页面类型(0版面、1文章)
_maq.push(['_paper_name', '河南日报']);//报纸名称
_maq.push(['_paper_type', '1']);//报纸类型(0Pc、1Wap)
_maq.push(['_paper_id', '1252']);//报纸ID
_maq.push(['_node_url', (window.location.href).split('?')[0] ]);//版面地址
_maq.push(['_page_title', $("title").html()]); //页面Title
_maq.push(['_editor', '']);//文章编辑
if (window.location.href.indexOf("node")>=0){//访问版面页面
_maq.push(['_node_num', $("#NewsEditionNumber").html()]);//版次
_maq.push(['_node_name', $("#NewsEditionName").html()]);//版面名称
_maq.push(['_article_title', '']);//文章标题
_maq.push(['_author', '']);//文章作者
}
if (window.location.href.indexOf("content")>=0){//访问文章页面
_maq.push(['_node_num', $("#NewsEditionNumber").html()]);//版次
_maq.push(['_node_name', $("#NewsEditionName").html()]);//版面名称
_maq.push(['_article_title', $("#NewsArticleTitle").html()]);//文章标题
_maq.push(['_author', $("#NewsArticleAuthor").html()]);//文章标题
//_maq.push(['_author', ($("founder-author").html().split('npm:article-author')[1]).replace(/[-><!/]?/g,'') ]);//文章作者
}
(function () {
var ma = document.createElement('script'); ma.type = 'text/javascript'; ma.async = true;
//ma.src = ('https:' == document.location.protocol ? 'https://www' : 'http://wwww') + '.soubao.net/ma.js';
ma.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'statlog.cnepaper.com/js/ma.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ma, s);
})();
}
$(function(){
//loadQFStat(); //前方统计
//loadCnzz();// cnzz统计
});
function loadCnzz(){
var la = document.createElement('script');
la.type = 'text/javascript';
la.async = true;
la.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 's4.cnzz.com/z_stat.php?id=1260208327&web_id=1260208327';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(la, s);
}