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.
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]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.
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?
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”
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.
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.
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 296I’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.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.