Google Analytics

Third-party modifications and add-ons, Apps and Clients

Moderator: moderators

Google Analytics

Postby kissiesteve » Tue Sep 04, 2012 7:38 pm

Hey guys, new to the forum. I want to add google analytics to my subsonic page so i can keep track of page hits and ip addresses
I know almost nothing about java but i am ok with html. can someone give me instructions on where i can add the google code?
kissiesteve
 
Posts: 2
Joined: Thu Aug 23, 2012 1:16 pm

Re: Google Analytics

Postby MadEvil » Tue Sep 04, 2012 9:03 pm

hi,

Just edit your \subsonic\jetty\<####>\webapp\script\scripts.js and ad this code

replace the UA-00000000-0 with your account id

that's all, this should work. mine does :wink:

Code: Select all
/// Google

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-00000000-0']);
  _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);
  })();


best regards

google.PNG
Madsonic Developer
User avatar
MadEvil
 
Posts: 354
Joined: Wed Nov 09, 2011 8:35 pm
Location: Vienna

Re: Google Analytics

Postby kissiesteve » Wed Sep 05, 2012 4:10 pm

Thank you so much, worked like a charm. i pasted that right at the top. Thanks for your time
kissiesteve
 
Posts: 2
Joined: Thu Aug 23, 2012 1:16 pm

Re: Google Analytics

Postby MadEvil » Wed Sep 05, 2012 7:25 pm

kissiesteve wrote:Thank you so much, worked like a charm. i pasted that right at the top. Thanks for your time

no problem :wink:
Madsonic Developer
User avatar
MadEvil
 
Posts: 354
Joined: Wed Nov 09, 2011 8:35 pm
Location: Vienna


Return to Mods, Apps and Clients

Who is online

Users browsing this forum: No registered users and 3 guests