【问题标题】:how to implement alexa certify script in the piwik?如何在 piwik 中实现 alexa 认证脚本?
【发布时间】:2017-09-30 08:12:38
【问题描述】:

如何在 piwik 子域中实现 alexa 脚本? 这是代码:

<script type=“text/javascript”>
_atrk_opts = { 
   atrk_acct:“KeWOp1P8cT20VRss”, domain:“example.com”,dynamic: true};
 (
 function() { 
  var as = document.createElement(‘script’); as.type = ‘text/javascript’; 
  as.async = true; 
  as.src = “https://d31qbv1cthcecs.cloudfront.net/atrk.js“; 
  var s = document.getElementsByTagName(‘script’)[0];
  s.parentNode.insertBefore(as, s); 
}
  )();
</script>
<noscript>
  <img src=“https://d5nxst8fruw4z.cloudfront.net/atrk.gif?account=KeWOp1P8cT20VR” style=“display:none” height=“1” width=“1" alt=“” /> 

【问题讨论】:

  • 请说明。

标签: php alexa


【解决方案1】:

您可以编辑布局文件:

plugins/Morpheus/templates/layout.twig

head 标记结束之前添加您的认证代码

<script type=“text/javascript”>
_atrk_opts = { 
   atrk_acct:“KeWOp1P8cT20VRss”, domain:“example.com”,dynamic: true};
 (
 function() { 
  var as = document.createElement(‘script’); as.type = ‘text/javascript’; 
  as.async = true; 
  as.src = “https://d31qbv1cthcecs.cloudfront.net/atrk.js“; 
  var s = document.getElementsByTagName(‘script’)[0];
  s.parentNode.insertBefore(as, s); 
}
  )();
</script>
<noscript>
  <img src=“https://d5nxst8fruw4z.cloudfront.net/atrk.gif?account=KeWOp1P8cT20VR” style=“display:none” height=“1” width=“1" alt=“” /> 
</noscript>
</head>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-12-07
    • 1970-01-01
    • 1970-01-01
    • 2019-03-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多