Page 1 of 2

Google Analytics

Posted: Wed Nov 12, 2008 12:17 am
by Geekboy
I just can't seem to get this to work.  I put the code in my template, no activity in Analytics.  I also put the code in my footer content block, still no activity showing up in Analytics.

Does anyone have a step by step guide for this?  Also, is there any other stats type module?

BTW, the site is my wife's daycare at http://www.justlikehomedaycare.org in case you can find something wrong.

Thanks for the help.

Re: Google Analytics

Posted: Wed Nov 12, 2008 12:19 am
by calguy1000
Seeing posts like this....

is there any wonder why the people with the knowledge to give help wont.

Re: Google Analytics

Posted: Wed Nov 12, 2008 12:24 am
by Geekboy
Thanks a lot for the help.  There is no reason to act like a jerk or elitist.

Is there something I'm missing by asking for help?  I searched the forums but did not find another post that really answered the question I had.  In fact this is the only one that stated where to put the code.  But there really is no answer as to where to post the code.

All I did was ask a question.  Thanks anyway.

Re: Google Analytics

Posted: Wed Nov 12, 2008 1:52 am
by hexdj
As mentioned by alby in the post you linked to, you just have to wrap your google javascript in {literal}{/literal} tags, and in that forum the original poster said that it's supposed to be before but it should really be inserted before the tag (notice its the closing tag)

So you should end up with something like this in your template:

Code: Select all

...
{literal}
<__script__ type="text/javascript"> <!-- your google javascript starts here, just paste it -->
... 
...
</__script>
{/literal}
<__body>
</__html>
if using a Global Content Block simply create a new one and it should look like this:

Code: Select all

{literal}
<__script__ type="text/javascript"> <!-- your google javascript starts here, just paste it -->
... 
...
</__script>
{/literal}
then stick it in your template and it would look like this:

Code: Select all

...
{global_content name="your_gcb"}
<__body>
</__html>
That should do it

Re: Google Analytics

Posted: Wed Nov 12, 2008 2:30 am
by Geekboy
Thanks for your response.

You said to post before before the tag but your code has it after.  I had it in the body tags before.  I changed it and followed the example shown in your code.  I'll see if that works

Once again thanks for helping.

Re: Google Analytics

Posted: Wed Nov 12, 2008 4:19 am
by hexdj
You're correct, my bad! I fixed my post to show the code as it should be.

Re: Google Analytics

Posted: Fri Nov 14, 2008 4:07 pm
by elliot
Hello Everybody. Im having pretty much the same problem. Im almost certain that ive included the tracking code correctly, in literal tags at the end of my template before the closing body tag.

The analytics account verifies that the code is there but no data shows up  ???

Its baffling me completely - Im going to contact google but if anybody here has any ideas id appreciate them.

Ill let you know what google says if I get a response.

Re: Google Analytics

Posted: Fri Nov 14, 2008 5:01 pm
by nhaack
When have you implemented the code? Please keep in mind that it may take up to 24 hours until you recieve the data

Best
Nils

Re: Google Analytics

Posted: Sat Nov 15, 2008 5:33 pm
by Geekboy
nhaack wrote: When have you implemented the code? Please keep in mind that it may take up to 24 hours until you recieve the data
I think that was my biggest problem.  But I also wanted the verify that I put the code in the correct location.

Re: Google Analytics

Posted: Mon Dec 08, 2008 5:57 pm
by JeremyBASS
fangji wrote: why the people with the knowledge to give help wont.???
try asking harder questions it's even harder to get help lol... No, in all realness most everyone is willing to help... sometimes it just takes a long while... though question could have been answered if the had used that nifty search thing above...  My2Cents
jeremyBass

Re: Google Analytics

Posted: Tue Feb 03, 2009 4:18 am
by Dr.CSS
The biggest reason this seemed like it wasn't getting answered is that the poster gave very little info...

If you called your mechanic with something like "my car don't start why can't you tell me how come" what do you think they would say...

It has been asked/told numerous times to get all the info you can, they even put new pages and tools into the system to help get it, Site Admin > System Information is one...

So once again if you want better help read these and it may help...

http://forum.cmsmadesimple.org/index.ph ... ,40.0.html

Re: Google Analytics

Posted: Sun May 24, 2009 12:04 am
by viebig
create an UDT(Extensions -> User defined tag), name it "ga"

Code: Select all

return '
<__script__ type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));
</__script>
<__script__ type="text/javascript">
try {
var pageTracker = _gat._getTracker("'.$params['id'].'");
pageTracker._trackPageview();
} catch(err) {}</__script>
';
use it like:

Code: Select all

{ga id="UA-555555-55"}
put it right before

Re: Google Analytics

Posted: Mon May 25, 2009 5:04 am
by hexdj
Thanks for the tip viebig!

Re: Google Analytics

Posted: Wed Jun 02, 2010 7:25 am
by ridelikeaturtle
viebig wrote: create an UDT(Extensions -> User defined tag), name it "ga"

Code: Select all

return '
<__script__ type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));
</__script>
<__script__ type="text/javascript">
try {
var pageTracker = _gat._getTracker("'.$params['id'].'");
pageTracker._trackPageview();
} catch(err) {}</__script>
';
use it like:

Code: Select all

{ga id="UA-555555-55"}
put it right before



Great post, thanks viebig!

As a follow on, this would now be

Code: Select all

return '
<__script__ type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push([\'_setAccount\', \''.$params['id'].'\']);
  _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>
';
... and the user-defined tag placed just before the tag of your pages (e.g., in your template layout).
;)

Re: Google Analytics

Posted: Sun Jun 06, 2010 8:57 pm
by cacharopnet
Thanks a lot! I have created the tag, but how can I know the id of the tag? like you have mentioned:id="UA-555555-55", does that mean I can use any id?