html - jquery - google analytics not pulling in the footer -
i trying add google anlytics html pages.the below page called rates.html.
<html> <head> <title></title> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script> $(function(){ $("#footer").load("footer.html"); }); </script> </head> <body> <div id="footer"></div> </body> </html>
on footer.html have following:
<html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="../css/stylesheet.css" /> <title>footer</title> </head> <body> <p align="center">numbers: +244 (0) 00000000 | lodge: +244 (0) 00000000 <br /> <a href="mailto:lodge@sidney.co.za%20" class="copy_link1">lodge@sidney.co.za </a>| <a href="mailto:reservations@sidney.co.za" class="copy_link1">reservations@samara.co.za</a></p> <p align="center">lorem ipsum dolor sit amet, consectetur adipisicing elit. voluptatibus temporibus sequi saepe eius dolorem iusto deleniti, numquam nemo provident sunt accusantium esse cum similique harum reprehenderit illum, facilis laudantium soluta!.</p> <p align="center"><a href="http://www.sidney.com/" class="copy_link1">seo powered ruby digital</a></p> <script> (function(i,s,o,g,r,a,m) { i['googleanalyticsobject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new date();a=s.createelement(o), m=s.getelementsbytagname(o) [0];a.async=1;a.src=g;m.parentnode.insertbefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'ua-12813356-1', 'auto', {'allowlinker': true}); ga('require', 'linker'); ga('send', 'pageview'); </script> </body> </html>
i can see paragraphs content.problem realized rates.html , other html pages don't pull analytics because when view page source,no analytics shown.
how can google analytics displayed in pages
put analytics in own js file. cant render in file .load() has js in it, html gets rendered, not js in file.
your rates.html this
<html> <head> <title></title> <script src="analytics.js"></script> </head> <body> body content here </body> </html>
then put analytics code in file called analytics.js
Comments
Post a Comment