hurray Posted November 6, 2013 Share Posted November 6, 2013 (edited) I am trying to add a code to monitor site performance between <head></head> tag in the website. I suppose I have to add the code in index.php file, right? But when I open the index.php file in public_html, there is no <head></head> tag. Edited November 6, 2013 by hurray (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted November 6, 2013 Share Posted November 6, 2013 No, you have to add it in header.tpl, located in the themes/yourthemename folder Link to comment Share on other sites More sharing options...
hurray Posted November 6, 2013 Author Share Posted November 6, 2013 Thank you for your reply. Are you sure I need to add the code in header.tpl file? When I add the script between <head> and </head> tag, it breaks my website. Link to comment Share on other sites More sharing options...
NemoPS Posted November 6, 2013 Share Posted November 6, 2013 Yes, 1000% sure. Can you share the code you pasted? There might be some error. Also, you might need to place it inside {literal} your code {/literal} Link to comment Share on other sites More sharing options...
hurray Posted November 6, 2013 Author Share Posted November 6, 2013 (edited) Here is the code. It is from pingdom and I it is going to test the load time of my website. <script>var _prum = [['id', '527a02ddabe53d5b13000000'], ['mark', 'firstbyte', (new Date()).getTime()]];(function() { var s = document.getElementsByTagName('script')[0] , p = document.createElement('script'); p.async = 'async'; p.src = '//rum-static.pingdom.net/prum.min.js'; s.parentNode.insertBefore(p, s);})();</script> Edited November 6, 2013 by hurray (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted November 6, 2013 Share Posted November 6, 2013 so your script using brackets. if any code you're trying to add use brackets - then you have to use {literal}{/literal} tags like i show below: {literal} <script> var _prum = [['id', '527a02ddabe53d5b13000000'], ['mark', 'firstbyte', (new Date()).getTime()]]; (function() { var s = document.getElementsByTagName('script')[0] , p = document.createElement('script'); p.async = 'async'; p.src = '//rum-static.pingdom.net/prum.min.js'; s.parentNode.insertBefore(p, s); })(); </script> {/literal} Link to comment Share on other sites More sharing options...
hurray Posted November 6, 2013 Author Share Posted November 6, 2013 Thank you very much both of you. Now it is working. Link to comment Share on other sites More sharing options...
Recommended Posts