Skip to main content
Level 2
February 5, 2014
Question

adding google analytics code to a landing page

  • February 5, 2014
  • 4 replies
  • 2360 views
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>

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

4 replies

February 5, 2014
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
February 5, 2014
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.
February 5, 2014
Also check out Google Tag Manager...makes changes to your Analytics code, AdWords conversion code, etc. very easy.
Trish_Voskovitc
Level 5
March 3, 2014
on each landing page do i just put in the Custom Head HTML area in the Edit Page Meta Tags area?