Re: adding google analytics code to a landing page

Megan_Raftery
Level 1

adding google analytics code to a landing page

Exactly what code should be added?  Do I keep all script tags?
This is what it looks like right now on the landing page:

<?php echo $mContext['endElements']; ?>
 
<!-- GOOGLE ANALYTICS.  ENTER YOUR CODE and UNCOMMENT block -->
 
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "
  (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-44599329-1', 'newscyclesolutions.com');
  ga('send', 'pageview');";
urchinTracker();
</script>
 
 
</body>
</html>

This is the google tracking script:
<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-44599329-1', 'newscyclesolutions.com');
  ga('send', 'pageview');
 
</script>

Tags (1)
4 REPLIES 4
Anonymous
Not applicable

Re: adding google analytics code to a landing page

I think you also want to look at where you put the conversion codes as well...We normailly use an HTML box to put those on a page vs. adding them to the Landing page template...
Josh_Hill13
Level 10 - Champion Alumni

Re: adding google analytics code to a landing page

You can place the GA script anywhere in the Header or Footer of the Template. You can delete the comment section you noted above and then replace it with the GA code you have.

Depending on your needs, you may need conversion code on a per page basis, rather than on the template.
Anonymous
Not applicable

Re: adding google analytics code to a landing page

Also check out Google Tag Manager...makes changes to your Analytics code, AdWords conversion code, etc. very easy.
Trish_Voskovitc
Level 5

Re: adding google analytics code to a landing page

on each landing page do i just put in the Custom Head HTML area in the Edit Page Meta Tags area?