Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Google Analytics Module installed successfully but all I get is waiting for data???


Go to End


4 Posts   1851 Views

Avatar
TF-35Lightning

Community Member, 137 Posts

23 April 2010 at 2:32pm

Hi all,

I have installed the google analytics module from silversluke but all I get from the google analytics control panel is:

Waiting for Data
Analytics has been successfully installed and data is being gathered now. ( I have waited a week but all I get is the little time icon and this message)

When I click on check status it shows me the code that I need to paste into the pages. Paste this code on your site:

<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("UA-8888888-8");
pageTracker._trackPageview();
} catch(err) {}</script>

So I pasted the above into your Google Analytics tab back in the SS admin and clicked save.
Paste Google's code below to collect statistics for this site Analytics Tracking etc.

I also notice that when I reload the page the above code turns into:
<script type='text/javascript'>
var pageTracker = _gat._getTracker("UA-3473533-7");
pageTracker._trackPageview();
</script>

Finally here is what my code looks like on the actual live website pages, any google related code:

<script src='http://www.google-analytics.com/ga.js' type='text/javascript'></script>
</head>

script type="text/javascript">//<![CDATA[
<script type='text/javascript'>var pageTracker = _gat._getTracker("UA-8888888-8");
pageTracker._trackPageview();
</script>//]]></script></body>
</html>

Just wondering if someone might have some ideas on what I am doing wrong, or what is going wrong.

Desperate to get this going, any help would be great. I'm on SS 2.4 btw.

Avatar
xeraa

Community Member, 58 Posts

12 May 2010 at 10:14am

Edited: 12/05/2010 10:14am

1) With allow_call_time_pass_reference disabled I get the warning

Warning: Call-time pass-by-reference has been deprecated in ...\googleanalytics\code\AnalyticsSetupDecorator.php  on line 38

I assume I can savely remove the & in
if (preg_match($pattern, $script, &$matches)) {
?

2) On the /admin/reports/ -> "Google Analytics" the links "View Google Analytics" and "Setup Google Analytics" do not work as the JS referenced in the onclick event is not loaded (from googleanalytics/code/AnalyticsReport.php line 36 to 45).

Using both Silverstripe and GoogleAnalytics trunk

Avatar
wysow

Community Member, 1 Post

16 May 2010 at 12:07am

Hello,

Like xeraa the 2 javascript functions are not loaded in the admin section of google analytics module so I can't put my code to track my visitors.

Any help would be appreciated.

Thanks

Avatar
xeraa

Community Member, 58 Posts

21 May 2010 at 11:04pm