We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

New extension: Google Analytics Panel

Development and Programming

neostructuralist's avatar
neostructuralist
6 posts
16 years ago
neostructuralist's avatar neostructuralist

Hey D-Rock,

Thanks for putting this great extension together! I installed v1.1.2 on a small site with EE 1.6.8 with PHP 5.2.6 to test it out.

Seems to setup ok, but when I actually compared the displayed data for Top Content in EE to the actual report in GA, the list and counts are slightly different. Some of the pages in the list seems to repeat in the EE version. And the counts are sometimes different.

I did notice that it might possibly have to do with the duplicates in EE adding up to match the total in GA. Not 100% but maybe a direction to look at if it might be a bug. Or am I doing something wrong here? Thanks for any help.

Have attached two screenshots - one from EE and one from the GA report.

       
Derek Hogue's avatar
Derek Hogue
317 posts
16 years ago
Derek Hogue's avatar Derek Hogue

neostructuralist - this is a problem with the GA API unfortunately. It reports visits to www.domain.com and domain.com separately, even though the Analytics UI reports combine them. IMO this is a bug. I’ve posted about it on the the API Group, and will see if I get any response from the team.

However, I would suggest using some .htaccess magic to prevent users from visiting your site at www.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]
       
neostructuralist's avatar
neostructuralist
6 posts
16 years ago
neostructuralist's avatar neostructuralist

Ahh, that makes sense. Thanks for the info, D-Rock. Hope they fix it. I do some redirects of non-www to www on sites so this issue then I believe would not show up on those sites.

In this case, the site is already a third level domain, and I did not have a rewrite rule yet. I tried your mod rewrite for www to non-www on my .htaccess file, but it did not work. So tried a different approach and also removed the domain name from the cond/rule. This one worked for me.

# redirect all www to non-www
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

Alternatively, if one wants to redirect the other way, all non-www to www, for their site, this one has worked for me in the past.

# redirect all non-www to www
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www..*
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} ^([^.]*).(com)
RewriteRule ^(.*)$ http://www.%1.%2%{REQUEST_URI} [R=301,L]

Think both respect third-level domains too.

       
Derek Hogue's avatar
Derek Hogue
317 posts
16 years ago
Derek Hogue's avatar Derek Hogue

I just pushed an update to GitHub which should resolve the duplicate page listings in the Top Content listing. neostructuralist, let me know if this works out for you?

       
neostructuralist's avatar
neostructuralist
6 posts
16 years ago
neostructuralist's avatar neostructuralist

Works like a charm! Tested it on two sites. Thanks for the update, D-Rock.

       
anthonys's avatar
anthonys
54 posts
16 years ago
anthonys's avatar anthonys

Feature Idea: I dunno if this is possible, but would be really cool:

I want to show most popular entries on pages, but that means I need to use the track_views EE feature. Problem is that I cache the entries pages for performance. When you cache, the track_views doesn’t work, so I can’t show the most popular entries. :(

Any way to use the google analytics data so I can show my most popular content based on that analytics data?

I’m thinking like once a day the analytics page views for each EE entry is stored in a database table. Would need to somehow hook that data up so you can use it in an entries tag like:

orderby=”most_pageviews_according_to_google_analytics”

       
the_crimsonrooster's avatar
the_crimsonrooster
264 posts
16 years ago
the_crimsonrooster's avatar the_crimsonrooster

GREAT EXT!! it rocks!!!!

one question - can you change the order of the cp? i want the GA panel on my top left.

       
Focus Lab Dev Team's avatar
Focus Lab Dev Team
1,129 posts
16 years ago
Focus Lab Dev Team's avatar Focus Lab Dev Team
one question - can you change the order of the cp? i want the GA panel on my top left.

I don’t know if there’s a direct link to it, but you can go to My Account > Customize Control Panel > Control Panel Homepage and click “Update”. This take you to the page where you re-order what’s on the page.

       
Derek Hogue's avatar
Derek Hogue
317 posts
16 years ago
Derek Hogue's avatar Derek Hogue

antonys - that’s an interesting idea, but a whole other extension I’m afraid. BTW, track_views is only compromised if you use template caching. Tag caching (cache=”yes” refresh=”1440”) doesn’t interfere with track_views.

therooster - use the big green “Set Order” button on the My Account ->Control Panel Homepage screen.

       
Focus Lab Dev Team's avatar
Focus Lab Dev Team
1,129 posts
16 years ago
Focus Lab Dev Team's avatar Focus Lab Dev Team
therooster - use the big green “Set Order” button on the My Account ->Control Panel Homepage screen.

Wow, yet another big green button I never looked at. Didn’t know it was there haha

       
the_crimsonrooster's avatar
the_crimsonrooster
264 posts
16 years ago
the_crimsonrooster's avatar the_crimsonrooster

thx. i really didn’t see it!

       
Peter Lewis's avatar
Peter Lewis
280 posts
16 years ago
Peter Lewis's avatar Peter Lewis

D-Rock,

Updated to latest version (v1.1.2) and it reset (cleared) all the settings. Was that suppose to happen?

Cheers

Peter

       
Derek Hogue's avatar
Derek Hogue
317 posts
16 years ago
Derek Hogue's avatar Derek Hogue

Peter - if you were upgrading from 1.0.X, then yes, it should have reset your settings. The MSM-support introduced in 1.1 meant a new settings schema.

       
Peter Lewis's avatar
Peter Lewis
280 posts
16 years ago
Peter Lewis's avatar Peter Lewis

Fair enough - just checking 😊 Thanks

       
Pigtail Dencil's avatar
Pigtail Dencil
117 posts
16 years ago
Pigtail Dencil's avatar Pigtail Dencil

First off, a note of love: awesome, awesome, sweet as…

Secondly, a bit of pain. I’ve just battled with my crummy server turning on PHP5 as a CGI script and then finding out that I also had to hack the index.php file to force query strings. I’m now running:

– PHP 5.2.11 – cURL support enabled – allow_url_fopen Off Off

However, when I go to input my a GA login details in the extension’s screen I’m returned with a choke:

Warning: include(/path/to/system/extensions/ext.Analytics_panel.php) [function.include]: failed to open stream: No such file or directory in /path/to/systems/cp/cp.utilities.php on line 395

Warning: include() [function.include]: Failed opening '/path/to/system/extensions/ext.Analytics_panel.php' for inclusion (include_path='.:/usr/lib/php5') in /path/to/system/cp/cp.utilities.php on line 395

Warning: Cannot modify header information - headers already sent by (output started at /path/to/system/cp/cp.utilities.php:395) in /path/to/system/core/core.functions.php on line 296

I’m guessing that it’s got something to do with my server’s lack of PATH_INFO support. Any clues.

(Again, it’s a real beauty when it does work)

UPDATE: Ignore me. I’m running 1.6.4 which is most likely the cause.

       
First 3 4 5 6 7 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.