-
AuthorPosts
-
June 30, 2019 at 7:05 am #1114562
Hi guyz,
It is pretting frustrating. I have tried at leat 10 times to add a script to my website, using this theme. And none of them never work. I have tried different things suggested, to my theme editor. google tag manager, code to verify my youtube channel, now I am trying to add another code (hotjar) into the header section, to visualize all the actions of my visitors. I have tested a lot of things suggested in the threads, none of them worked.
I always have this same error. “Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP.”
I need to fix this so I can implement all the codes into my website. Please I need a solution to be able to insert codes. Is there something wrong?
Below the one I need to add onto my header section:
<!– Hotjar Tracking Code for http://www.digitalsuccessguide.com –>
<script>
(function(h,o,t,j,a,r){
h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
h._hjSettings={hjid:1383965,hjsv:6};
a=o.getElementsByTagName(‘head’)[0];
r=o.createElement(‘script’);r.async=1;
r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
a.appendChild(r);
})(window,document,’https://static.hotjar.com/c/hotjar-‘,’.js?sv=’);
</script>June 30, 2019 at 8:50 am #1114570in head section you can try this in child-theme functions.php:
add_action( 'wp_head', 'custom_tracking_script' ); function custom_tracking_script() { ?> <!– Hotjar Tracking Code for http://www.digitalsuccessguide.com –> <script> (function(h,o,t,j,a,r){ h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)}; h._hjSettings={hjid:1383965,hjsv:6}; a=o.getElementsByTagName('head')[0]; r=o.createElement('script');r.async=1; r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv; a.appendChild(r); })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv='); </script> <?php }
this is definitly the right way to embed but if the script isn’t loaded with warnings – you have to check the the code from hotjar
June 30, 2019 at 8:54 am #1114571PS : please always use here on board for code the code-block tag – it is easier to test for us by copy paste the codes inside – as you can do now with the code above.
June 30, 2019 at 8:59 pm #1114698Hi arthurepassa,
Did you get it working with the suggestion above or do you need more help?
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.