Page 1 of 1

Google Analytics

PostPosted: 25 Mar 2014, 14:39
by geeman
Hello, i want to use Google Webmaster Tools and Google Analytics with the site, they provide me with a code i need to enter into each page of my website in order for the stats to become available.

The script they give me is:

<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-48706323-2', 'bankrepossessionsinspain.co.uk');
ga('send', 'pageview');

</script>

How can i incorporate this into the pages?

Many thanks for all your support

Gino

Re: Google Analytics

PostPosted: 25 Mar 2014, 15:51
by Xpycm

Re: Google Analytics

PostPosted: 25 Mar 2014, 16:58
by geeman
Can i just copy the Google Analytic code in between the entry you mention?

For example:

<div class="footer">
<?php echo getGA(); ?>
<p class="slogan">&copy;&nbsp;<?php echo CHtml::encode(Yii::app()->name).', '.date('Y'); ?></p>
<!-- <?php echo param('version_name').' '.param('version'); ?> -->

<div align="center">
<!-- <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-48706323-2', 'bankrepossessionsinspain.co.uk');
ga('send', 'pageview');

</script> -->
</div>
</div

Re: Google Analytics

PostPosted: 25 Mar 2014, 17:50
by Xpycm
Of course or before closing body tag