Hi Teitbite
The errror was a blanc page with a error message that stated that there was an error in de head.php on the line where te GA code started.
In het original templates "Steakhouse and Creativity" (in "Hotel" there was a closing tag, in "University" de GA code still works when inserted in the settings of the template) the last php-codes were not closed by a
- Code: Select all
?>
So for others with the problem. I put the closing-tag like this:
- Code: Select all
...................................
<?php
if(
JRequest::getCmd('option') == 'com_config' ||
(
JRequest::getCmd('option') == 'com_content' &&
JRequest::getCmd('layout') == 'edit'
)
) {
$doc = JFactory::getDocument();
$doc->addStyleSheet($this->API->URLbase() . '/media/jui/css/bootstrap.min.css');
$doc->addStyleSheet($this->API->URLbase() . '/media/jui/css/bootstrap-responsive.min.css');
$doc->addStyleSheet($this->API->URLbase() . '/media/jui/css/bootstrap-extended.css');
$doc->addStyleSheet($this->API->URLbase() . '/media/jui/css/icomoon.css');
$doc->addStyleSheet($this->API->URLbase() . '/media/jui/css/chosen.css');
$doc->addStyleSheet($this->API->URLbase() . '/media/media/css/mediamanager.css');
}
// EOF
?>(was missing)
(and then I put het GA code)
<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','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-xxxxxxx-x', 'auto');
ga('send', 'pageview');
</script>
Succes!