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.

All other Modules /

Discuss all other Modules here.

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

Google Analytics unserialize() error


Reply


2 Posts   1434 Views

Avatar
duyfken

Community Member, 3 Posts

25 September 2009 at 10:03pm

Edited: 25/09/2009 10:08pm

I really don't know what the heck is going on here, I have tryed the new and old Google Analytics code but it still throws up the same errors. :S Can anybody help?

I'm running SilverStripe 2.3.1 and Google Analytics module r85133.

Error info:

[Notice] unserialize() [function.unserialize]: Error at offset 43 of 50 bytes
GET /

Line 31 in /var/www/vhosts/anglicandnwa.org/httpdocs/googleanalytics/code/CrawlerStats.php
Source

22       "Yahoo" => "Yahoo",
23       "MSN" => "msnbot");
24    
25    /**
26     * UpdateCrawls should be called on a page load with the user-agent loading that page
27     * if the user agent matches one of the known spiders, then it's crawler entry will be
28     * updated appropriately.
29     */
30    public function UpdateCrawls($agent) {
31       $data = unserialize($this->Data);
32       
33       $index = 0;
34       $updated = false;
35       foreach (self::$spiders as $pattern) {
36          if(stristr($agent,$pattern)) {
37             $data[$index] = time();

Trace

* unserialize(a:3:{i:0;i:1253683079;i:1;i:1253749592;i:2;i:12537)
Line 31 of CrawlerStats.php
* CrawlerStats->UpdateCrawls(Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729))
Line 54 of GoogleAnalytics.php
* GoogleAnalytics::initialize()
* call_user_func(Array)
Line 646 of Director.php
* Director::set_site_mode(site)
Line 102 of ContentController.php
* ContentController->init()
Line 23 of Page.php
* Page_Controller->init()
Line 113 of Controller.php
* Controller->handleRequest(HTTPRequest)
Line 28 of ModelAsController.php
* ModelAsController->handleRequest(HTTPRequest)
Line 34 of RootURLController.php
* RootURLController->handleRequest(HTTPRequest)
Line 277 of Director.php
* Director::handleRequest(HTTPRequest,Session)
Line 121 of Director.php
* Director::direct()
Line 115 of main.php

Avatar
pouic

Community Member, 19 Posts

21 September 2011 at 8:10pm

Put your project in live mode and try again.

_config.php
Director::set_environment_type("live");