After inserting Google Analytics code in footer.tpl, the footer disapeared
Posted by netfuchs
|
After inserting Google Analytics code in footer.tpl, the footer disapeared December 16, 2013 02:57AM |
Registered: 12 years ago Posts: 2 |
I inserted the following code in the file footer.tpl of my template.
After that, the whole footer disapeared.
Where ist the mistake?
Thanks for your help.
[code="html4strict"]
<!-- BEGIN TEMPLATE footer.tpl -->
<div id="footer-plug">
This <a href="[www.phorum.org];
is powered by <a href="[www.phorum.org];.
</div>
</div> <!-- end of div id="phorum" -->
<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', 'XX-XXXXXXXX-X', 'mydomain.tld');
ga('send', 'pageview');
</script>
</body>
</html>
<!-- END TEMPLATE footer.tpl -->
[/code]
After that, the whole footer disapeared.
Where ist the mistake?
Thanks for your help.
[code="html4strict"]
<!-- BEGIN TEMPLATE footer.tpl -->
<div id="footer-plug">
This <a href="[www.phorum.org];
is powered by <a href="[www.phorum.org];.
</div>
</div> <!-- end of div id="phorum" -->
<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', 'XX-XXXXXXXX-X', 'mydomain.tld');
ga('send', 'pageview');
</script>
</body>
</html>
<!-- END TEMPLATE footer.tpl -->
[/code]
|
Re: After inserting Google Analytics code in footer.tpl, the footer disapeared March 29, 2014 06:36AM |
Registered: 12 years ago Posts: 2 |
|
Re: After inserting Google Analytics code in footer.tpl, the footer disapeared March 29, 2014 06:45AM |
Registered: 12 years ago Posts: 2 |
The "{" was the problem. (it was so obviously...)
You need to put your code this way:
[code="javascript"]
<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', 'XX-XXXXXXXX-X', 'mydomain.tld');
ga('send', 'pageview');
</script>
[/code]
You need to put your code this way:
[code="javascript"]
<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', 'XX-XXXXXXXX-X', 'mydomain.tld');
ga('send', 'pageview');
</script>
[/code]
|
Re: After inserting Google Analytics code in footer.tpl, the footer disapeared July 31, 2014 04:42AM |
Registered: 12 years ago Posts: 2 |
|
Re: After inserting Google Analytics code in footer.tpl, the footer disapeared June 19, 2015 02:02PM |
Registered: 15 years ago Posts: 71 |
Sorry, only registered users may post in this forum.