Extension: Google Analytics

Discuss PivotX 2.0.x extensions here, and view extensions that are available for download.

Re: Extension: Google Analytics

Postby hansfn » Tue Aug 16, 2011 1:55 pm

Oh, I see what is going on. The extension isn't HTML5 safe ;-) The hook tries to insert the GA code right before the end of the head element. Unfortunately, the regular expression matches "</head". Your template contains the HTML5 header element whose end tag also matches "</head". I think the fix is very easy:

In hook_googleanalytics.php (around line 140) replace

Code: Select all
$html = preg_replace('#</head#si', $output."</head", $html);

with

Code: Select all
$html = preg_replace('#</head#si', $output."</head", $html, 1);

Let me know if that worked.
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Extension: Google Analytics

Postby localhost » Tue Aug 16, 2011 2:19 pm

Thanks Hans. That worked (for me).
--People who say it cannot be done, should not interrupt those who are doing it.--
User avatar
localhost
 
Posts: 57
Joined: Fri Jan 25, 2008 8:23 am
Location: NL

Re: Extension: Google Analytics

Postby hansfn » Sun Jan 01, 2012 5:58 pm

Just released version 0.7.1 which fixes a typo - 'Web Property ID' was wrongly written as 'Web Propery ID' - and the problem with the header element in HTML5 (reported above).

PS! If you are happily using version 0.7 there is no need to upgrade.
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Extension: Google Analytics

Postby Logfather » Thu Aug 16, 2012 8:28 am

Hey Hans! Is it possible that when you enable two-step authentication on your Google account (this involves receiving a pincode on your mobile phone when you want to get into your account) it blocks out the Google Analytics plugin?

So far I don't think it has interfered with statistics but I noticed the diagram on my admin panel has stopped. ;)
Logfather
 
Posts: 163
Joined: Sun Jul 12, 2009 9:29 am
Location: Amsterdam

Re: Extension: Google Analytics

Postby hansfn » Fri Aug 17, 2012 7:07 am

You need to get a application-specific password from Google.
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Extension: Google Analytics

Postby Logfather » Fri Aug 17, 2012 9:13 am

I see and just paste that in the Google account password in the extensions' settings?
Logfather
 
Posts: 163
Joined: Sun Jul 12, 2009 9:29 am
Location: Amsterdam

Re: Extension: Google Analytics

Postby hansfn » Fri Aug 17, 2012 10:04 am

Yes.
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Extension: Google Analytics

Postby Logfather » Fri Aug 17, 2012 6:45 pm

Thank you Hans! This should be mentioned in the plugin no?

Code: Select all
Are you using two-factor authentication on your Google account? Generate an application-specific password and use this (without spaces) instead of your normal Google account password.
Logfather
 
Posts: 163
Joined: Sun Jul 12, 2009 9:29 am
Location: Amsterdam

Re: Extension: Google Analytics

Postby loriswave » Fri Oct 05, 2012 3:10 pm

Hi,
i have install and set but when click for test recive this error

"Testing Google Analytics Login

logged in successfully!

Warning: Unknown error when accessing the Google Analytics API, HTTP STATUS 404 in /membri/loriswave/pivotx/extensions/googleanalytics/analytics_api.php on line 118

No accounts found."

some one can help me
loriswave
 
Posts: 10
Joined: Mon Aug 31, 2009 1:04 pm

Re: Extension: Google Analytics

Postby Harm10 » Sat Aug 31, 2013 10:35 pm

Version 1.7.2 is published. Contains 2 new options: setting the path variable for the cookies and switching off display of stats in the dashboard. The latter doesn't work any more because the new API has not been incorporated yet. Anyone who wants to do that please feel free.
Quality is in the detail of things............

Want to change or update your PivotX site? Mail or PM me!
I can also convert your site to a Wordpress site!
Harm10
Developer
 
Posts: 2011
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)

Previous

Return to 2.x Extensions

Who is online

Users browsing this forum: No registered users and 3 guests

cron