The mandatory question: Do you know of much that prevents a D6 backport of this?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Balbo’s picture

Component: Code » Miscellaneous

+1

(Can't find something similar in Drupal 6)

vlooivlerke’s picture

subscribe

jec006’s picture

I think it should definitely be doable - just need to basically backport the views integration to views 2

Ken Hawkins’s picture

Happened upon this new module, Nice Dash.

It provides Google Analytics integration along with a dashboard for 6.x ... so there's feature bloat compared to this module. Still it may be of interest to some

http://drupal.org/project/nice_dash

Balbo’s picture

Ken, I just need a way to display the "most viewed" page on my site, once disabled the core "Statistics" module. The module you linked gives a google analytics panel inside my site?

baff’s picture

subscribe

GreenReaper’s picture

Subscribe, definitely!

tanc’s picture

Status: Active » Needs review
FileSize
1.63 KB

Here's a very quick and untested D6 backport. I should get a chance to test it later today.

zzzp’s picture

Thanks, tanc!
I'd been working with a similar idea myself, but you beat me to it with this patch ;-)
Have tested it against a site I'm building and it works fine.

jec006’s picture

Hey Guys,

Let me know how this patch works and we'll get it committed.

Balbo’s picture

The patch does not apply nor to dev-version, nor to beta.
I applied it "by hand" and I'm trying the module on a Drupal 6.20, it seems to work.

edit: the module patched seems to work, as I can configure it via admin/settings/ga_stats and can add several Statistics fields inside my Views BUT those fields aren't showing any values ("label:" followed by nothing).

Balbo’s picture

Here is why:
the site I was using to test the module was like http://xxx.xxx.xxx.xxx/drupal6test

And in the ga_stats.module the function ga_stats_get_data is using

if (!preg_match('/node\/([0-9]*)/', $alias, $matches) ) {

and

if (preg_match('/node\/([0-9]*)/', $alias, $matches)  ) {

while (in my case) it should use:

if (!preg_match('/^drupal6test\/node\/([0-9]*)/', $alias, $matches) ) {

and

if (preg_match('/^drupal6test\/node\/([0-9]*)/', $alias, $matches)  ) {

I'm not sure wether is an error in my configuration or it is better to modify somehow the regular expression.

Balbo’s picture

FileSize
6.43 KB

Updated patch.
Can you please commit it to a 6version's module?

twohlix’s picture

The preg_match stuff should be in a different issue, but thank you for bringing that up.

Im testing the 6.x patch right now.

karljohann’s picture

Awesome

karljohann’s picture

I'm not getting any results to show. I'm using Views 3, could that be a problem?

Edit: The problems seems to be that the data from GA is very little still.

scothiam’s picture

Subscribing. Patch in #13 worked for me using Views 3, thanks! I did need to manually edit the info file after patching, I'll attempt to edit the patch to reflect that, test, and upload.

twohlix’s picture

karljohann, is it working now that you've got some data populating your site?

twohlix’s picture

Status: Needs review » Needs work

Scothiam, would you mind uploading your patch so we can close this out?

scothiam’s picture

FileSize
8.52 KB

Sorry for the delay. First patch, don't shoot me.

scothiam’s picture

apologies, again, first patch, getting up to speed on the patching standards. I am currently testing this patch, stay tuned.

Update: works fine for me.

  • Balbos patch as in http://drupal.org/node/1197744#comment-5428216 (thank you!)
  • additional changes to .info file that I made in order to successfully install this module on D6
  • changed views api from 2 to 3
  • some comments to README.txt that could be ignored or further edited
karljohann’s picture

@twohlix I'm not quite sure how to get the data to update more regularly, we have a site with a few hudred thousand pageviews per day and at the end of the day the most popular posts still have 0 views, which is a bit off ... aside from that it seems to work fine.

twohlix’s picture

@scothiam your patch was done from the directory above ga_stats (which isnt right). I did a quick regex to replace the of /ga_stats/ with just / but that didnt work. Would you mind remaking the patch from the ga_stats directory? Thanks for your help with this port.

@karljohann cron controls how often ga_stats is pulling data from google analytics.

scothiam’s picture

sorry about that twohlix, I'll try to get a few minutes this weekend to recreate the patch correctly. Thanks, I appreciate the feedback, I'd rather learn and get it right.

scothiam’s picture

Status: Needs work » Needs review
FileSize
21.11 KB

Try this again, sorry for the delay. I followed the steps here, http://drupal.org/node/707484
Let me know if I missed anything, again, I appreciate the feedback.

Thanks again to everyone that actually worked on this module (jec006, twohlix, ?) and the port (Balbo, tanc). Glad I can help even if only a little.
Cheers,

twohlix’s picture

Scothiam, awesome. Patch is made against an older version and includes stuff like:

+    
+    //this is used because views currently lowercases field names but we're getting camelCase from google.
+    $mkl = strtolower($mk); 
+    

which is already in dev's latest. Would you mind rerolling the patch against latest version?

git pull before you git diff. :) Thanks a ton for the work you've been doing.

scothiam’s picture

oops! I'll try to get that out after 5pm today. Cheers, (sorry for the delay, putting out other fires, will get the latest dev version to create a patch against when I can get back to this)

aze2010’s picture

subscribing :-)

Balbo’s picture

Hey guys, any news on this issue? Will we have a backport (d6) of the module? Thanks :)

frankie’s picture

I'm interested in backport for D6. Any news?

brunodbo’s picture

Issue summary: View changes
FileSize
3.84 KB

Rerolled patch against the 7.x-1.x branch, since that branch seemed to have the latest.

Successfully tested it on a D6 install, with a hosted Google account, and requesting 2000 results for a given timeframe.

brunodbo’s picture

Title: Drupal 6 feasibility » Drupal 6 version
nicholas.alipaz’s picture

Status: Needs review » Needs work

The permission used in this version is 'administer site config' and it should be 'administer site configuration' in hook_menu().