Closed (fixed)
Project:
Gallery
Version:
5.x-2.x-dev
Component:
User Interface / Theming
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
23 Oct 2007 at 15:13 UTC
Updated:
2 Nov 2007 at 22:56 UTC
I add the code in theme.tpl of Gallery2 to use Google Analytics (Please reference this: http://codex.gallery2.org/Gallery2:How_To_Add_Google_Analytics_to_my_Gal...)
<link rel="stylesheet" type="text/css" href="{g->theme url="theme.css"}"/>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-XXXXXX-X";
urchinTracker();
</head>
</script>It's ok when I use Firefox to open my Gallery2 page (http://localhost/drupal/gallery2), but when I open Drupal's gallery page (http://localhost/drupal/gallery), I got the javascript error "urchinTracker is not defined", I checked the source code, I found the following code is not existed in the source of Drupal page.
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>Should I just remove Google Analytics from Gallery2 and use the Drupal's Google Analytics module ? But if I still want to use Google Analytics for standalone Gallery2, is there any idea ?
Comments
Comment #1
profix898 commentedAre you sure you inserted the Google Analytics code correctly? I just tried and added it after
{g->debug}in theme.tpl (as described in http://codex.gallery2.org/Gallery2:How_To_Add_Google_Analytics_to_my_Gal...) and it works correctly both standalone and embedded.Another possible solution is to check for embedded operation and insert the code for standalone G2 only. For statistics on your Drupal site you can then use the module or add the Google code to your page.tpl.php.
Comment #2
dennys commentedOh, sorry, it's my fault. I put the Google Analytics code in section, I just changed to the code after {g->debug}, it's ok now.
Comment #3
profix898 commented-