Google Analytics Code Not Working - FIXED IN V3.3

Post Reply
Posts: 1
Joined: Fri Jul 05, 2013 11:01 am

Google Analytics Code Not Working - FIXED IN V3.3

Post by rabika » Fri Jul 05, 2013 11:05 am

The google analytics code that comes with v2.11, does not seem to be recognized by google. Not sure whether this is because google changed something or whether there is a bug in phpauction.

Replacing the code in class/Core/PresentationData.php->getGoogleAnalyticsCode() with the one that google recommends (upon registration), seems to fix it

Site Admin
Posts: 750
Joined: Fri Jan 08, 2010 2:23 am
Location: Stoke-on-Trent

Re: Google Analytics Code Not Working

Post by RWAP » Fri Jul 05, 2013 1:37 pm

I have moved this discussion to a new topic which is more relevent !

You are correct - the code being used in Enuuk is apparently no longer supported by google.

My class\Core\PresentationData.php now contains the following function:

Code: Select all

    static public function getGoogleAnalyticsCode(Core_Context $context)
		$gaCode = '<script type="text/javascript">
		      var _gaq = _gaq || [];
		_gaq.push(["_setAccount", "UA-xxxxxxx-x"]);

		(function() {
		  var ga = document.createElement("script"); ga.type = "text/javascript"; ga.async = true;
		  ga.src = ("https:" == document.location.protocol ? "https://ssl" : "http://www") + "";
		  var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ga, s);
            return str_replace('UA-xxxxxxx-x', $context->siteOptions['googleAnalyticsID'], $gaCode);
            return '';

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest