Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
Jamroom Help:
Where to paste Google analytic code
slimtugo



Joined: 19 May 2013
Posts: 78

Posted: 10/13/13 12:58 
Where do I paste google analytic code? I tried putting it in header.tpl and the site failed to load.

Back to top
Dazed



Joined: 22 Mar 2006
Posts: 4147

Posted: 10/13/13 14:23 
Just add it to the footer.

Back to top
slimtugo



Joined: 19 May 2013
Posts: 78

Posted: 10/13/13 15:14 
That did not work. I get a white screen once i add the analytic code either to the header or footer template file.

Thanks

Back to top
Dazed



Joined: 22 Mar 2006
Posts: 4147

Posted: 10/13/13 15:20 
If you are on jr4 you will probably need to wrap it in literal tags.

<lireral>
Code

</literal>

Back to top
slimtugo



Joined: 19 May 2013
Posts: 78

Posted: 10/13/13 15:21 
Am using jr5

Back to top
Dazed



Joined: 22 Mar 2006
Posts: 4147

Posted: 10/13/13 17:03 

slimtugo:
Am using jr5


I would try the literals and rule it out. If it does not work, post the code you are using and remove your code number. something is not right here.

Back to top
slimtugo



Joined: 19 May 2013
Posts: 78

Posted: 10/13/13 19:21 
When i added literal, it loaded the page without the footer.


Code

<literal>
<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', '', '');
  ga('send', 'pageview');

</script>
</literal>


Back to top
Dazed



Joined: 22 Mar 2006
Posts: 4147

Posted: 10/13/13 19:37 
ok took a look at it. You should probably put this in the meta.tpl file in the <head> section. You should not need the literals there.

Back to top
slimtugo



Joined: 19 May 2013
Posts: 78

Posted: 10/13/13 19:53 
It still didn't work.

Back to top
Dazed



Joined: 22 Mar 2006
Posts: 4147

Posted: 10/13/13 20:01 
make sure you are not tucking it inside an <if> statement in there. I spaced adding mine into JR5 so your post served as a reminder. I added mine at the bottom of the file. Also if this is the first time you are adding it through the JR5 template editor, make sure you save the entry, click the Active link box next to meta.tpl and the refresh cache.




Code
<head>
other code

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-xxxxxxxxx-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
</head>


Back to top
slimtugo



Joined: 19 May 2013
Posts: 78

Posted: 10/13/13 20:12 
I pasted mine as you did - right before the closing header tag. I set cache to 0 so i get a fresh copy when i refresh. Am using ftp, so once i add the analytic code and upload, i get a white screen.

Back to top
Dazed



Joined: 22 Mar 2006
Posts: 4147

Posted: 10/13/13 20:16 
Is the code you are posting the same or different? It looks like it is missing some info.

Back to top
slimtugo



Joined: 19 May 2013
Posts: 78

Posted: 10/13/13 20:34 
I removed it on purpose

Back to top
blindmime



Joined: 07 Mar 2004
Posts: 1107

Posted: 10/13/13 21:29 
I had to use the smarty literal tags on one of my analytic codes. And didn't have to on others.

Smarty literal tags are done with
{literal}
code
{/literal}

Not with "<literal></literal>"


_________________
tapegerm.com
homemademusic.com
Back to top
slimtugo



Joined: 19 May 2013
Posts: 78

Posted: 10/13/13 21:41 
Thanks it seems to be working.

Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
Jamroom Help

 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.