How do i insert a script
-
Hey guys. I am helping a company with their WordPress website which is using AMP.
They want me to add a script to the website, and i have tried adding it through functions.php, header.php and footer.php, but it doesn’t load on the website. What am i doing wrong? Should i add it somewhere else?I tried adding this in functions.php:
function my_footerscripts(){ ?> <script type="text/javascript"> (function(e,t,o,n,p,r,i){e.visitorGlobalObjectAlias=n;e[e.visitorGlobalObjectAlias]=e[e.visitorGlobalObjectAlias]||function(){(e[e.visitorGlobalObjectAlias].q=e[e.visitorGlobalObjectAlias].q||[]).push(arguments)};e[e.visitorGlobalObjectAlias].l=(new Date).getTime();r=t.createElement("script");r.src=o;r.async=true;i=t.getElementsByTagName("script")[0];i.parentNode.insertBefore(r,i)})(window,document,"https://diffuser-cdn.app-us1.com/diffuser/diffuser.js","vgo"); vgo('setAccount', 'XXXXXTHEIR_IDXXXXX'); vgo('setTrackByDefault', true); vgo('process'); </script> <?php };
And i also need to add this script:
<!-- Byggfakta Analytics Pro --> <script async defer type="text/javascript" src="https://stats.docu.info/docu-snippet.js" id="docu-snippet" data-site-id="7" data-domain-id="XXXTHEIR_IDXXX"></script> <!-- End Byggfakta Analytics Pro -->
UUID ampwp-2b9fe708-2a91-51df-a85a-a02b65260d14
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘How do i insert a script’ is closed to new replies.