Alireza Amrollahi Alireza Amrollahi - 3 years ago 180
PHP Question

how to implement alexa certify script in the piwik?

how to implement alexa script in piwik subdomain?
here is the code :

<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=“” />



Answer Source

you can edit layout file :

plugins/Morpheus/templates/layout.twig

add your certify code before end of head tag

<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>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download